| 1 | <?php |
||
| 19 | trait EventGeneratorMethods |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @var array|Event[] |
||
| 23 | */ |
||
| 24 | protected $events = []; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Records that a domain event has occurred |
||
| 28 | * |
||
| 29 | * @param Event $event |
||
| 30 | */ |
||
| 31 | public function recordThat(Event $event): void |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Releases the previously recorded events |
||
| 38 | * |
||
| 39 | * @return Event[]|array |
||
| 40 | */ |
||
| 41 | public function releaseEvents(): array |
||
| 47 | } |
||
| 48 |