3 * Zend Framework (http://framework.zend.com/)
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
10 namespace Zend\Console
;
12 use Zend\Stdlib\Message
;
13 use Zend\Stdlib\ResponseInterface
;
15 class Response
extends Message
implements ResponseInterface
20 protected $contentSent = false;
23 * Check if content was sent
28 public function contentSent()
30 return $this->contentSent
;
34 * Set the error level that will be returned to shell.
36 * @param int $errorLevel
39 public function setErrorLevel($errorLevel)
41 if (is_string($errorLevel) && ! ctype_digit($errorLevel)) {
45 $this->setMetadata('errorLevel', $errorLevel);
50 * Get response error level that will be returned to shell.
54 public function getErrorLevel()
56 return $this->getMetadata('errorLevel', 0);
65 public function sendContent()
67 if ($this->contentSent()) {
70 echo $this->getContent();
71 $this->contentSent
= true;
78 public function send()
81 $errorLevel = (int) $this->getMetadata('errorLevel', 0);