1 | <?php |
||
17 | class BusHelper implements HelperInterface |
||
18 | { |
||
19 | private $helperSet; |
||
20 | |||
21 | private $commandBus; |
||
22 | |||
23 | private $queryBus; |
||
24 | |||
25 | 2 | public function setCommandBus(BusInterface $commandBus): BusHelper |
|
26 | { |
||
27 | 2 | $this->commandBus = $commandBus; |
|
28 | |||
29 | 2 | return $this; |
|
30 | } |
||
31 | |||
32 | public function setQueryBus(BusInterface $queryBus): BusHelper |
||
38 | |||
39 | 8 | public function setHelperSet(HelperSet $helperSet = null) |
|
45 | |||
46 | /** |
||
47 | * Gets the helper set associated with this helper. |
||
48 | * |
||
49 | * @return HelperSet A HelperSet instance |
||
50 | */ |
||
51 | public function getHelperSet() |
||
55 | |||
56 | /** |
||
57 | * Returns the canonical name of this helper. |
||
58 | * |
||
59 | * @return string The canonical name |
||
60 | */ |
||
61 | 8 | public function getName() |
|
65 | |||
66 | 1 | public function postCommand($message) |
|
67 | { |
||
68 | 1 | if (!$this->commandBus) { |
|
69 | throw new \RuntimeException( |
||
70 | 'Command bus is not configured' |
||
71 | ); |
||
72 | } |
||
73 | |||
74 | 1 | $this->commandBus->post($message); |
|
75 | 1 | } |
|
76 | |||
77 | public function postQuery($message) |
||
87 | } |
||
88 |