3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\Console
;
12 use Zend\Stdlib\Message
;
13 use Zend\Stdlib\ResponseInterface
;
15 class Response
extends Message
implements ResponseInterface
21 protected $contentSent = false;
24 * Check if content was sent
29 public function contentSent()
31 return $this->contentSent
;
35 * Set the error level that will be returned to shell.
37 * @param int $errorLevel
40 public function setErrorLevel($errorLevel)
42 $this->setMetadata('errorLevel', $errorLevel);
47 * Get response error level that will be returned to shell.
51 public function getErrorLevel()
53 return $this->getMetadata('errorLevel', 0);
62 public function sendContent()
64 if ($this->contentSent()) {
67 echo $this->getContent();
68 $this->contentSent
= true;
75 public function send()
78 $errorLevel = (int) $this->getMetadata('errorLevel',0);