setParam('response', $response); $this->response = $response; return $this; } /** * @return \Zend\Stdlib\ResponseInterface */ public function getResponse() { return $this->response; } /** * Set content sent for current response * * @return SendResponseEvent */ public function setContentSent() { $response = $this->getResponse(); $contentSent = $this->getParam('contentSent', []); $contentSent[spl_object_hash($response)] = true; $this->setParam('contentSent', $contentSent); $this->contentSent[spl_object_hash($response)] = true; return $this; } /** * @return bool */ public function contentSent() { $response = $this->getResponse(); if (isset($this->contentSent[spl_object_hash($response)])) { return true; } return false; } /** * Set headers sent for current response object * * @return SendResponseEvent */ public function setHeadersSent() { $response = $this->getResponse(); $headersSent = $this->getParam('headersSent', []); $headersSent[spl_object_hash($response)] = true; $this->setParam('headersSent', $headersSent); $this->headersSent[spl_object_hash($response)] = true; return $this; } /** * @return bool */ public function headersSent() { $response = $this->getResponse(); if (isset($this->headersSent[spl_object_hash($response)])) { return true; } return false; } }