src/Domain/Model/AggregateRoot.php
protected function initializeCommittedVersion(int $committedVersion): void
    {
        if (!$this->eventCollection()->isEmpty()) {
            $message = 'Cannot initialize version after recording events';
            throw new OperationException($message);
        }

        $this->eventCollection()->initializeSequence($committedVersion);
    }
protected function initializeCommittedVersion(int $committedVersion): void
    {
        if (!$this->eventCollection()->isEmpty()) {
            $message = 'Cannot initialize version after recording events';
            throw new OperationException($message);
        }

        $this->eventCollection()->initializeSequence($committedVersion);
    }
protected function initializeCommittedVersion ( int $ committedVersion ) : void { if ( ! $ this -> eventCollection ( ) -> isEmpty ( ) ) { $ message = 'Cannot initialize version after recording events' ; throw new OperationException ( $ message ) ; } $ this -> eventCollection ( ) -> initializeSequence ( $ committedVersion ) ; }
Initializes the committed version

@param int $committedVersion the initial version

@return void

@throws OperationException When called with recorded events
Initializes the committed version