PHP 클래스 Prooph\EventStore\Aggregate\AggregateRepository

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

보호된 프로퍼티들

프로퍼티 타입 설명
$aggregateTranslator Prooph\EventStore\Aggregate\AggregateTranslator
$aggregateType AggregateType
$eventStore Prooph\EventStore\EventStore
$identityMap array
$oneStreamPerAggregate boolean
$snapshotStore Prooph\EventStore\Snapshot\SnapshotStore | null
$streamName Prooph\EventStore\Stream\StreamName

공개 메소드들

메소드 설명
__construct ( EventStore $eventStore, AggregateType $aggregateType, Prooph\EventStore\Aggregate\AggregateTranslator $aggregateTranslator, SnapshotStore $snapshotStore = null, StreamName $streamName = null, boolean $oneStreamPerAggregate = false )
addAggregateRoot ( object $eventSourcedAggregateRoot )
addPendingEventsToStream ( ) Repository acts as listener on EventStore.commit.pre events In the listener method the repository checks its identity map for pending events and appends the events to the event stream.
extractAggregateVersion ( object $aggregateRoot ) : integer
getAggregateRoot ( string $aggregateId ) : null | object Returns null if no stream events can be found for aggregate root otherwise the reconstituted aggregate root

보호된 메소드들

메소드 설명
assertAggregateType ( object $eventSourcedAggregateRoot )
determineStreamName ( string | null $aggregateId ) : StreamName Default stream name generation.
enrichEventMetadata ( Prooph\Common\Messaging\Message $domainEvent, string $aggregateId ) : Prooph\Common\Messaging\Message Add aggregate_id and aggregate_type as metadata to $domainEvent Override this method in an extending repository to add more or different metadata.
loadFromSnapshotStore ( string $aggregateId ) : null | object

메소드 상세

__construct() 공개 메소드

public __construct ( EventStore $eventStore, AggregateType $aggregateType, Prooph\EventStore\Aggregate\AggregateTranslator $aggregateTranslator, SnapshotStore $snapshotStore = null, StreamName $streamName = null, boolean $oneStreamPerAggregate = false )
$eventStore Prooph\EventStore\EventStore
$aggregateType AggregateType
$aggregateTranslator Prooph\EventStore\Aggregate\AggregateTranslator
$snapshotStore Prooph\EventStore\Snapshot\SnapshotStore
$streamName Prooph\EventStore\Stream\StreamName
$oneStreamPerAggregate boolean

addAggregateRoot() 공개 메소드

public addAggregateRoot ( object $eventSourcedAggregateRoot )
$eventSourcedAggregateRoot object

addPendingEventsToStream() 공개 메소드

Repository acts as listener on EventStore.commit.pre events In the listener method the repository checks its identity map for pending events and appends the events to the event stream.

assertAggregateType() 보호된 메소드

protected assertAggregateType ( object $eventSourcedAggregateRoot )
$eventSourcedAggregateRoot object

determineStreamName() 보호된 메소드

Override this method in an extending repository to provide a custom name
protected determineStreamName ( string | null $aggregateId ) : StreamName
$aggregateId string | null
리턴 Prooph\EventStore\Stream\StreamName

enrichEventMetadata() 보호된 메소드

Add aggregate_id and aggregate_type as metadata to $domainEvent Override this method in an extending repository to add more or different metadata.
protected enrichEventMetadata ( Prooph\Common\Messaging\Message $domainEvent, string $aggregateId ) : Prooph\Common\Messaging\Message
$domainEvent Prooph\Common\Messaging\Message
$aggregateId string
리턴 Prooph\Common\Messaging\Message

extractAggregateVersion() 공개 메소드

public extractAggregateVersion ( object $aggregateRoot ) : integer
$aggregateRoot object
리턴 integer

getAggregateRoot() 공개 메소드

Returns null if no stream events can be found for aggregate root otherwise the reconstituted aggregate root
public getAggregateRoot ( string $aggregateId ) : null | object
$aggregateId string
리턴 null | object

loadFromSnapshotStore() 보호된 메소드

protected loadFromSnapshotStore ( string $aggregateId ) : null | object
$aggregateId string
리턴 null | object

프로퍼티 상세

$aggregateTranslator 보호되어 있는 프로퍼티

protected AggregateTranslator,Prooph\EventStore\Aggregate $aggregateTranslator
리턴 Prooph\EventStore\Aggregate\AggregateTranslator

$aggregateType 보호되어 있는 프로퍼티

protected AggregateType,Prooph\EventStore\Aggregate $aggregateType
리턴 AggregateType

$eventStore 보호되어 있는 프로퍼티

protected EventStore,Prooph\EventStore $eventStore
리턴 Prooph\EventStore\EventStore

$identityMap 보호되어 있는 프로퍼티

protected array $identityMap
리턴 array

$oneStreamPerAggregate 보호되어 있는 프로퍼티

protected bool $oneStreamPerAggregate
리턴 boolean

$snapshotStore 보호되어 있는 프로퍼티

protected SnapshotStore,Prooph\EventStore\Snapshot|null $snapshotStore
리턴 Prooph\EventStore\Snapshot\SnapshotStore | null

$streamName 보호되어 있는 프로퍼티

protected StreamName,Prooph\EventStore\Stream $streamName
리턴 Prooph\EventStore\Stream\StreamName