PHP 클래스 Prooph\EventSourcing\AggregateRoot

저자: Alexander Miertsch ([email protected])
파일 보기 프로젝트 열기: prooph/event-sourcing 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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