1<?php
2/**
3 * Zend Framework (http://framework.zend.com/)
4 *
5 * @link      http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license    http://framework.zend.com/license/new-bsd     New BSD License
8 */
9
10namespace Zend\View\Model;
11
12class ConsoleModel extends ViewModel
13{
14    const RESULT = 'result';
15
16    /**
17     * Console output doesn't support containers.
18     *
19     * @var string
20     */
21    protected $captureTo = null;
22
23    /**
24     * Console output should always be terminal.
25     *
26     * @var bool
27     */
28    protected $terminate = true;
29
30    /**
31     * Set error level to return after the application ends.
32     *
33     * @param int $errorLevel
34     */
35    public function setErrorLevel($errorLevel)
36    {
37        $this->options['errorLevel'] = $errorLevel;
38    }
39
40    /**
41     * @return int
42     */
43    public function getErrorLevel()
44    {
45        if (array_key_exists('errorLevel', $this->options)) {
46            return $this->options['errorLevel'];
47        }
48    }
49
50    /**
51     * Set result text.
52     *
53     * @param string  $text
54     * @return \Zend\View\Model\ConsoleModel
55     */
56    public function setResult($text)
57    {
58        $this->setVariable(self::RESULT, $text);
59        return $this;
60    }
61
62    /**
63     * Get result text.
64     *
65     * @return mixed
66     */
67    public function getResult()
68    {
69        return $this->getVariable(self::RESULT);
70    }
71}
72