Source of file ExceptionEvent.php
Size: 1,997 Bytes - Last Modified: 2014-03-12T23:21:18+01:00
/home/theseer/Downloads/ZendFramework-2.3.0/library/Zend/Cache/Storage/ExceptionEvent.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 | <?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Cache\Storage; use ArrayObject; use Exception; class ExceptionEvent extends PostEvent { /** * The exception to be thrown * * @var Exception */ protected $exception; /** * Throw the exception or use the result * * @var bool */ protected $throwException = true; /** * Constructor * * Accept a target and its parameters. * * @param string $name * @param StorageInterface $storage * @param ArrayObject $params * @param mixed $result * @param Exception $exception */ public function __construct($name, StorageInterface $storage, ArrayObject $params, & $result, Exception $exception) { parent::__construct($name, $storage, $params, $result); $this->setException($exception); } /** * Set the exception to be thrown * * @param Exception $exception * @return ExceptionEvent */ public function setException(Exception $exception) { $this->exception = $exception; return $this; } /** * Get the exception to be thrown * * @return Exception */ public function getException() { return $this->exception; } /** * Throw the exception or use the result * * @param bool $flag * @return ExceptionEvent */ public function setThrowException($flag) { $this->throwException = (bool) $flag; return $this; } /** * Throw the exception or use the result * * @return bool */ public function getThrowException() { return $this->throwException; } } |