1: <?php
2:
3: namespace Racoon\Api\Exception;
4:
5:
6: use Racoon\Api\Request;
7:
8: class Exception extends \Exception
9: {
10:
11: 12: 13:
14: protected $request;
15:
16: 17: 18:
19: protected $displayAsError;
20:
21: public function __construct(Request $request = null, $displayAsError = false, $message, $code = 0, \Exception $previous = null)
22: {
23: parent::__construct($message, $code, $previous);
24: $this->setRequest($request);
25: $this->setDisplayAsError($displayAsError == true);
26: }
27:
28:
29: 30: 31:
32: public function getRequest()
33: {
34: return $this->request;
35: }
36:
37:
38: 39: 40:
41: public function setRequest($request = null)
42: {
43: $this->request = $request;
44: }
45:
46:
47: 48: 49:
50: public function shouldDisplayAsError()
51: {
52: return $this->displayAsError;
53: }
54:
55:
56: 57: 58:
59: public function setDisplayAsError($displayAsError)
60: {
61: $this->displayAsError = $displayAsError;
62: }
63:
64: }