Total Complexity | 2 |
Total Lines | 23 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
10 | trait EventRecordingCapabilities |
||
11 | { |
||
12 | private $events = []; |
||
13 | |||
14 | /** |
||
15 | * Use this method inside your aggregate to record new domain events. |
||
16 | */ |
||
17 | 24 | protected function recordThat(object $event): void |
|
18 | { |
||
19 | 24 | $this->events[] = $event; |
|
20 | 24 | } |
|
21 | |||
22 | /** |
||
23 | * @see \TalisOrm\Aggregate::releaseEvents() |
||
24 | * @return object[] |
||
25 | */ |
||
26 | 23 | public function releaseEvents(): array |
|
33 | } |
||
34 | } |
||
35 |