src/Domain/EventSourcing/EventSourcedEntity.php
public function registerAggregateRoot(EventSourcedAggregateRoot $aggregateRoot): void
    {
        if ($this->aggregateRoot !== null && $this->aggregateRoot !== $aggregateRoot) {
            throw new DomainException('Aggregate root already registered');
        }

        $this->aggregateRoot = $aggregateRoot;
    }
public function registerAggregateRoot(EventSourcedAggregateRoot $aggregateRoot): void
    {
        if ($this->aggregateRoot !== null && $this->aggregateRoot !== $aggregateRoot) {
            throw new DomainException('Aggregate root already registered');
        }

        $this->aggregateRoot = $aggregateRoot;
    }
public function registerAggregateRoot ( EventSourcedAggregateRoot $ aggregateRoot ) : void { if ( $ this -> aggregateRoot !== null && $ this -> aggregateRoot !== $ aggregateRoot ) { throw new DomainException ( 'Aggregate root already registered' ) ; } $ this -> aggregateRoot = $ aggregateRoot ; }
Registers the aggregate root

@internal

@param EventSourcedAggregateRoot $aggregateRoot The aggregate root

@return void

@throws DomainException
Registers the aggregate root