1 | <?php |
||
14 | abstract class Event implements EventInterface |
||
15 | { |
||
16 | /** |
||
17 | * store information how many times event object was called |
||
18 | * |
||
19 | * @var int |
||
20 | */ |
||
21 | protected static $launchCount = 0; |
||
22 | |||
23 | /** |
||
24 | * store information that event propagation is stopped or not |
||
25 | * |
||
26 | * @var bool |
||
27 | */ |
||
28 | protected $propagationStopped = false; |
||
29 | |||
30 | /** |
||
31 | * @var array |
||
32 | */ |
||
33 | protected $eventParameters = []; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $eventName = ''; |
||
39 | |||
40 | /** |
||
41 | * create event instance |
||
42 | * |
||
43 | * @param string $eventName |
||
44 | * @param array $parameters |
||
45 | */ |
||
46 | public function __construct($eventName, array $parameters) |
||
53 | |||
54 | /** |
||
55 | * return number how many times event was called |
||
56 | * |
||
57 | * @return int |
||
58 | */ |
||
59 | public static function getLaunchCount() |
||
63 | |||
64 | /** |
||
65 | * return information that event propagation is stopped or not |
||
66 | * |
||
67 | * @return bool |
||
68 | */ |
||
69 | public function isPropagationStopped() |
||
73 | |||
74 | /** |
||
75 | * allow to stop event propagation |
||
76 | * |
||
77 | * @return $this |
||
78 | */ |
||
79 | public function stopPropagation() |
||
84 | |||
85 | /** |
||
86 | * @return string |
||
87 | */ |
||
88 | public function getEventCode() |
||
92 | |||
93 | /** |
||
94 | * @return array |
||
95 | */ |
||
96 | public function getEventParameters() |
||
100 | } |
||
101 |