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\Cache\Storage
;
15 class ExceptionEvent
extends PostEvent
18 * The exception to be thrown
25 * Throw the exception or use the result
29 protected $throwException = true;
34 * Accept a target and its parameters.
37 * @param StorageInterface $storage
38 * @param ArrayObject $params
39 * @param mixed $result
40 * @param Exception $exception
42 public function __construct($name, StorageInterface
$storage, ArrayObject
$params, & $result, Exception
$exception)
44 parent
::__construct($name, $storage, $params, $result);
45 $this->setException($exception);
49 * Set the exception to be thrown
51 * @param Exception $exception
52 * @return ExceptionEvent
54 public function setException(Exception
$exception)
56 $this->exception
= $exception;
61 * Get the exception to be thrown
65 public function getException()
67 return $this->exception
;
71 * Throw the exception or use the result
74 * @return ExceptionEvent
76 public function setThrowException($flag)
78 $this->throwException
= (bool) $flag;
83 * Throw the exception or use the result
87 public function getThrowException()
89 return $this->throwException
;