EventStore
Event store for publishing a domain event and retrieving an aggregate's history.
- Full name:
\Codefy\Domain\EventSourcing\EventStore
Methods
append
Append a domain event to the event store.
Parameters:
Parameter | Type | Description |
---|---|---|
$event | \Codefy\Domain\EventSourcing\DomainEvent |
commit
Appends a list of domain events to the event store.
public commit(\Codefy\Domain\EventSourcing\DomainEvent $events): \Codefy\Domain\EventSourcing\Transactional
Parameters:
Parameter | Type | Description |
---|---|---|
$events | \Codefy\Domain\EventSourcing\DomainEvent |
getAggregateHistoryFor
Retrieve aggregate's history based on aggregate id.
public getAggregateHistoryFor(\Codefy\Domain\Aggregate\AggregateId $aggregateId): \Codefy\Domain\EventSourcing\EventStream
Parameters:
Parameter | Type | Description |
---|---|---|
$aggregateId | \Codefy\Domain\Aggregate\AggregateId |
Throws:
loadFromPlayhead
public loadFromPlayhead(\Codefy\Domain\Aggregate\AggregateId $aggregateId, int $playhead): \Codefy\Domain\EventSourcing\EventStream
Parameters:
Parameter | Type | Description |
---|---|---|
$aggregateId | \Codefy\Domain\Aggregate\AggregateId | |
$playhead | int |
Throws:
Automatically generated on 2025-10-13