1 | <?php |
||
21 | abstract class AbstractEvent extends LeagueAbstractEvent implements EventInterface |
||
22 | { |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $entityName; |
||
28 | |||
29 | /** |
||
30 | * @var EntityInterface |
||
31 | */ |
||
32 | protected $entity; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $action = 'none'; |
||
38 | |||
39 | /** |
||
40 | * @var mixed |
||
41 | */ |
||
42 | protected $params; |
||
43 | |||
44 | /** |
||
45 | * All ORM events are from entities |
||
46 | * |
||
47 | * @param EntityInterface $entity |
||
48 | * @param mixed $params additional parameters |
||
49 | */ |
||
50 | 4 | public function __construct(EntityInterface $entity, $params = null) |
|
55 | |||
56 | /** |
||
57 | * Sets the name of the class that triggers the event |
||
58 | * |
||
59 | * @param string $className |
||
60 | * @return self|EventInterface|$this |
||
61 | */ |
||
62 | public function setEntityName($className) |
||
67 | |||
68 | /** |
||
69 | * Gets the entity class name that triggers the event |
||
70 | * |
||
71 | * @return string |
||
72 | */ |
||
73 | public function getEntityName() |
||
80 | |||
81 | /** |
||
82 | * Set event's action |
||
83 | * |
||
84 | * @param string $action |
||
85 | * @return self|EventInterface|$this |
||
86 | */ |
||
87 | 4 | public function setAction($action) |
|
92 | |||
93 | /** |
||
94 | * Sets the entity object that triggers the event |
||
95 | * |
||
96 | * @param EntityInterface $entity |
||
97 | * @return self|EventInterface|$this |
||
98 | */ |
||
99 | 4 | public function setEntity(EntityInterface $entity) |
|
104 | |||
105 | /** |
||
106 | * Gets the entity object that triggers the event |
||
107 | * |
||
108 | * @return EntityInterface |
||
109 | */ |
||
110 | public function getEntity() |
||
114 | |||
115 | /** |
||
116 | * Get the event name. |
||
117 | * |
||
118 | * @return string |
||
119 | */ |
||
120 | 4 | public function getName() |
|
124 | } |