public function apply($event): void
    {
        $this->handleRecursively($event);

        ++$this->playhead;
        $this->uncommittedEvents[] = DomainMessage::recordNow(
            $this->getAggregateRootId(),
            $this->playhead,
            new Metadata([]),
            $event
        );
    }
public function apply($event): void
    {
        $this->handleRecursively($event);

        ++$this->playhead;
        $this->uncommittedEvents[] = DomainMessage::recordNow(
            $this->getAggregateRootId(),
            $this->playhead,
            new Metadata([]),
            $event
        );
    }
public function apply ( $ event ) : void { $ this -> handleRecursively ( $ event ) ; ++ $ this -> playhead ; $ this -> uncommittedEvents [ ] = DomainMessage :: recordNow ( $ this -> getAggregateRootId ( ) , $ this -> playhead , new Metadata ( [ ] ) , $ event ) ; }
Applies an event. The event is added to the AggregateRoot's list of uncommitted events.

@param mixed $event
Applies an event . The event is added to the AggregateRoot s list of uncommitted events .