1 | <?php |
||
29 | class Event |
||
30 | { |
||
31 | /** |
||
32 | * @api |
||
33 | * |
||
34 | * @var string The name of the event |
||
35 | * |
||
36 | * @since 1.0 |
||
37 | */ |
||
38 | private $name; |
||
39 | |||
40 | /** |
||
41 | * @api |
||
42 | * |
||
43 | * @var mixed Contains the event's data |
||
44 | * |
||
45 | * @since 1.0 |
||
46 | */ |
||
47 | private $data; |
||
48 | |||
49 | /** |
||
50 | * @api |
||
51 | * |
||
52 | * @var mixed Who fired this event |
||
53 | * |
||
54 | * @since 1.0 |
||
55 | */ |
||
56 | private $caller; |
||
57 | |||
58 | /** |
||
59 | * @api |
||
60 | * |
||
61 | * @var bool Indicates if the event is cancelled |
||
62 | * |
||
63 | * @since 1.0 |
||
64 | */ |
||
65 | private $cancelled = false; |
||
66 | |||
67 | /** |
||
68 | * @api |
||
69 | * |
||
70 | * @var Mediator|null An instance of the main Mediator class |
||
71 | * |
||
72 | * @since 1.0 |
||
73 | */ |
||
74 | private $mediator = null; |
||
75 | |||
76 | /** |
||
77 | * @api |
||
78 | * |
||
79 | * @var array Contains the results of previous event handlers |
||
80 | * |
||
81 | * @since 1.0 |
||
82 | */ |
||
83 | private $previousResults = []; |
||
84 | |||
85 | /** |
||
86 | * Constructor method of Event. |
||
87 | * |
||
88 | * All of these properties' usage details are left up to the event handler, |
||
89 | * so see your event handler to know what to pass here. |
||
90 | * |
||
91 | * @api |
||
92 | * |
||
93 | * @param string $name The name of the event |
||
94 | * @param mixed $data Data to be used by the event's handler (optional) |
||
95 | * @param mixed $caller The calling object or class name (optional) |
||
96 | * |
||
97 | * @since 1.0 |
||
98 | * |
||
99 | * @version 1.0 |
||
100 | */ |
||
101 | public function __construct($name, $data = null, $caller = null) |
||
107 | |||
108 | /** |
||
109 | * @return mixed |
||
110 | */ |
||
111 | public function __get($name) |
||
119 | |||
120 | public function __set($name, $val) |
||
141 | } |
||
142 |