PHP Класс Prooph\EventSourcing\AggregateRoot

Автор: Alexander Miertsch ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$recordedEvents AggregateChanged[] List of events that are not committed to the EventStore
$version integer Current version

Защищенные методы

Метод Описание
__construct ( ) We do not allow public access to __construct, this way we make sure that an aggregate root can only be constructed by static factories
aggregateId ( ) : string
apply ( AggregateChanged $e ) Apply given event
determineEventHandlerMethodFor ( AggregateChanged $e ) : string Determine event name
popRecordedEvents ( ) : AggregateChanged[] Get pending events and reset stack
reconstituteFromHistory ( Iterator $historyEvents ) : static
recordThat ( AggregateChanged $event ) Record an aggregate changed event
replay ( Iterator $historyEvents ) : void Replay past events

Описание методов

__construct() защищенный метод

We do not allow public access to __construct, this way we make sure that an aggregate root can only be constructed by static factories
protected __construct ( )

aggregateId() абстрактный защищенный метод

abstract protected aggregateId ( ) : string
Результат string representation of the unique identifier of the aggregate root

apply() защищенный метод

Apply given event
protected apply ( AggregateChanged $e )
$e AggregateChanged

determineEventHandlerMethodFor() защищенный метод

Determine event name
protected determineEventHandlerMethodFor ( AggregateChanged $e ) : string
$e AggregateChanged
Результат string

popRecordedEvents() защищенный метод

Get pending events and reset stack
protected popRecordedEvents ( ) : AggregateChanged[]
Результат AggregateChanged[]

reconstituteFromHistory() защищенный статический метод

protected static reconstituteFromHistory ( Iterator $historyEvents ) : static
$historyEvents Iterator
Результат static

recordThat() защищенный метод

Record an aggregate changed event
protected recordThat ( AggregateChanged $event )
$event AggregateChanged

replay() защищенный метод

Replay past events
protected replay ( Iterator $historyEvents ) : void
$historyEvents Iterator
Результат void

Описание свойств

$recordedEvents защищенное свойство

List of events that are not committed to the EventStore
protected AggregateChanged[],Prooph\EventSourcing $recordedEvents
Результат AggregateChanged[]

$version защищенное свойство

Current version
protected int $version
Результат integer