src/Aggregates/EventSourced.php
public function recordThat(DomainEvent $event)
    {
        $this->bumpVersion();

        if (is_null($this->uncommittedEvents)) {
            $this->uncommittedEvents = new UncommittedEvents($this->getIdentity());
        }

        $this->uncommittedEvents->append($event);
        $this->when($event);

        return $this;
    }
public function recordThat(DomainEvent $event)
    {
        $this->bumpVersion();

        if (is_null($this->uncommittedEvents)) {
            $this->uncommittedEvents = new UncommittedEvents($this->getIdentity());
        }

        $this->uncommittedEvents->append($event);
        $this->when($event);

        return $this;
    }
public function recordThat ( DomainEvent $ event ) { $ this -> bumpVersion ( ) ; if ( is_null ( $ this -> uncommittedEvents ) ) { $ this -> uncommittedEvents = new UncommittedEvents ( $ this -> getIdentity ( ) ) ; } $ this -> uncommittedEvents -> append ( $ event ) ; $ this -> when ( $ event ) ; return $ this ; }
Register a event happening on the aggregate

@param DomainEvent $event
@return static
Register a event happening on the aggregate