1 | <?php |
||
21 | class StoredEvent extends AbstractEvent implements Event |
||
22 | { |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $eventClassName; |
||
28 | |||
29 | /** |
||
30 | * @var null|mixed |
||
31 | */ |
||
32 | private $data = null; |
||
33 | |||
34 | /** |
||
35 | * Creates a stored event from other event |
||
36 | * |
||
37 | * @param Event $event |
||
38 | * |
||
39 | * @return StoredEvent |
||
40 | */ |
||
41 | public static function createFromEvent(Event $event): StoredEvent |
||
55 | |||
56 | /** |
||
57 | * Specify data which should be serialized to JSON |
||
58 | * |
||
59 | * @return mixed data which can be serialized by json_encode(), |
||
60 | * which is a value of any type other than a resource. |
||
61 | */ |
||
62 | public function jsonSerialize() |
||
72 | |||
73 | /** |
||
74 | * Original event FQ Class name |
||
75 | * |
||
76 | * @return string |
||
77 | */ |
||
78 | public function eventClassName(): string |
||
82 | |||
83 | /** |
||
84 | * Data from event serialization |
||
85 | * |
||
86 | * @return mixed|null |
||
87 | */ |
||
88 | public function data() |
||
92 | |||
93 | /** |
||
94 | * @return Event |
||
95 | * @throws \ReflectionException |
||
96 | */ |
||
97 | public function event(): Event |
||
111 | |||
112 | private function assignProperties(ReflectionClass $reflection, array $properties, Event $event): Event |
||
127 | |||
128 | /** |
||
129 | * Used to unserialize from a stored event |
||
130 | * |
||
131 | * @param mixed $data |
||
132 | */ |
||
133 | public function unserializeEvent($data): void |
||
137 | } |
||
138 |