1 | <?php |
||
19 | final class EntityEvent extends Event |
||
20 | { |
||
21 | /** |
||
22 | * The FQCN of the entity that this event handles. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | private $entityClassName; |
||
27 | |||
28 | /** |
||
29 | * A flag that indicates whether or not propagation can be stopped. |
||
30 | * |
||
31 | * @var bool |
||
32 | */ |
||
33 | private $canStopPropagation; |
||
34 | |||
35 | /** |
||
36 | * The error message that can occur when working with the entity. |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | private $error; |
||
41 | |||
42 | /** |
||
43 | * The error code of the error that can occur when working with the entity. |
||
44 | * |
||
45 | * @var integer |
||
46 | */ |
||
47 | private $errornr; |
||
48 | |||
49 | /** |
||
50 | * The result of a service manager call. |
||
51 | * |
||
52 | * @var mixed |
||
53 | */ |
||
54 | private $result; |
||
55 | |||
56 | /** |
||
57 | * Initializes a new instance of this class. |
||
58 | * Accepts a target and its parameters. |
||
59 | * |
||
60 | * @param string $name Event name The name of the event. |
||
61 | * @param string|object $target The target of the event. |
||
62 | * @param array|ArrayAccess $params Additional parameters of this event. |
||
63 | */ |
||
64 | 159 | public function __construct($name = null, $target = null, $params = null) |
|
70 | |||
71 | /** |
||
72 | * Gets the list with entities that are the result of this event. |
||
73 | * |
||
74 | * @return mixed Returns the result of a service manager call. |
||
75 | */ |
||
76 | 54 | public function getResult() |
|
80 | |||
81 | /** |
||
82 | * Sets the list with entities that are the result of this event. |
||
83 | * |
||
84 | * @param mixed $result The result of a service manager call. |
||
85 | * @return EntityEvent Returns the instance of this class so that chaining can be used. |
||
86 | */ |
||
87 | 42 | public function setResult($result) |
|
92 | |||
93 | /** |
||
94 | * Gets the FQCN of the entity that is used. |
||
95 | * |
||
96 | * @return string Returns a string containing the FQCN. |
||
97 | */ |
||
98 | 105 | public function getEntityClassName() |
|
102 | |||
103 | /** |
||
104 | * Sets the FQCN of the entity that is used. |
||
105 | * |
||
106 | * @param string $name The FQCN of the entity. |
||
107 | * @return EntityEvent Returns the instance of this class so that chaining can be used. |
||
108 | * @throws RuntimeException |
||
109 | */ |
||
110 | 117 | public function setEntityClassName($name) |
|
122 | |||
123 | /** |
||
124 | * Enables or disables further event propagation. |
||
125 | * |
||
126 | * @param bool $flag A flag that indicates whether or not to stop propagation. |
||
127 | * @return void |
||
128 | */ |
||
129 | 54 | public function stopPropagation($flag = true) |
|
135 | |||
136 | /** |
||
137 | * Disable the option of stopping the event propagation |
||
138 | * |
||
139 | * @return self |
||
140 | */ |
||
141 | 48 | public function disableStoppingOfPropagation() |
|
146 | |||
147 | /** |
||
148 | * Gets the message of the error that occurred when working with the entity. |
||
149 | * |
||
150 | * @return string |
||
151 | */ |
||
152 | 6 | public function getError() |
|
156 | |||
157 | /** |
||
158 | * Sets the message of the error that occurred when working with the entity. |
||
159 | * |
||
160 | * @param string $error The error message to set. |
||
161 | * @return self |
||
162 | */ |
||
163 | 9 | public function setError($error) |
|
168 | |||
169 | /** |
||
170 | * Gets the error number of the error that occurred when working with the entity. |
||
171 | * |
||
172 | * @return integer |
||
173 | */ |
||
174 | 9 | public function getErrorNr() |
|
178 | |||
179 | /** |
||
180 | * Sets the error number of the error that occurred when working with the entity. |
||
181 | * |
||
182 | * @param integer $errorNr The error number to set. |
||
183 | * @return EntityEvent Returns the instance of this class so that chaining can be used. |
||
184 | */ |
||
185 | 12 | public function setErrorNr($errorNr) |
|
190 | |||
191 | /** |
||
192 | * Checks if error information is set. |
||
193 | * |
||
194 | * @return bool Returns true when error information is set; false otherwise. |
||
195 | */ |
||
196 | 12 | public function isError() |
|
200 | } |
||
201 |