1 | <?php |
||
9 | class EventForwarder |
||
10 | { |
||
11 | /** |
||
12 | * @var PushServerInterface |
||
13 | */ |
||
14 | private $pushServer; |
||
15 | |||
16 | /** |
||
17 | * @var EventDispatcherInterface |
||
18 | */ |
||
19 | private $dispatcher; |
||
20 | |||
21 | /** |
||
22 | * @var EventSerializer |
||
23 | */ |
||
24 | private $eventSerializer; |
||
25 | |||
26 | /** |
||
27 | * @var bool |
||
28 | */ |
||
29 | private $enabled; |
||
30 | |||
31 | /** |
||
32 | * @param PushServerInterface $pushServer |
||
33 | * @param EventDispatcherInterface $dispatcher |
||
34 | * @param EventSerializer $eventSerializer |
||
35 | * @param bool $enabled |
||
36 | */ |
||
37 | public function __construct( |
||
48 | |||
49 | /** |
||
50 | * Forward an Event to Push Server. |
||
51 | * |
||
52 | * @param Event $event |
||
53 | * @param string $name |
||
54 | */ |
||
55 | public function forwardEvent(Event $event, $name) |
||
63 | |||
64 | /** |
||
65 | * Automatically forward RestApi events to push server. |
||
66 | * |
||
67 | * @param string|string[] $eventNames Can be an event name or an array of event names. |
||
68 | * |
||
69 | * @return self |
||
70 | */ |
||
71 | public function forwardAllEvents($eventNames) |
||
90 | } |
||
91 |