1 | <?php |
||
10 | trait ConstructionBehaviour |
||
11 | { |
||
12 | |||
13 | /** |
||
14 | * @var AggregateRootId |
||
15 | */ |
||
16 | protected $aggregateRootId; |
||
17 | |||
18 | 7 | public function __construct(AggregateRootId $aggregateRootId) |
|
22 | |||
23 | 7 | public function aggregateRootId(): AggregateRootId |
|
27 | |||
28 | /** |
||
29 | * @param AggregateRootId $aggregateRootId |
||
30 | * @param Generator $events |
||
31 | * |
||
32 | * @return static |
||
33 | */ |
||
34 | 7 | public static function reconstituteFromEvents(AggregateRootId $aggregateRootId, Generator $events): AggregateRoot |
|
45 | |||
46 | abstract protected function apply(Event $event); |
||
47 | } |