protected function raise(DomainEvent $event): void {
        $this->apply($event);
        $this->streamEvents = $this->streamEvents->add(
            new StreamEvent($this->aggregateId(), $this->aggregateVersion(), $event)
        );
    }
protected function raise(DomainEvent $event): void {
        $this->apply($event);
        $this->streamEvents = $this->streamEvents->add(
            new StreamEvent($this->aggregateId(), $this->aggregateVersion(), $event)
        );
    }
protected function raise ( DomainEvent $ event ) : void { $ this -> apply ( $ event ) ; $ this -> streamEvents = $ this -> streamEvents -> add ( new StreamEvent ( $ this -> aggregateId ( ) , $ this -> aggregateVersion ( ) , $ event ) ) ; }
raise an event from within the aggregate. this applies
the event to the aggregate state and stores it in the
pending stream events collection awaiting flush.

@param DomainEvent $event
raise an event from within the aggregate . this applies the event to the aggregate state and stores it in the pending stream events collection awaiting flush .