EventSourcedAggregate
- Full name:
\Codefy\Domain\Aggregate\EventSourcedAggregate
- This class implements:
\Codefy\Domain\Aggregate\AggregateRoot
,\Codefy\Domain\Aggregate\IsEventSourced
Properties
aggregateId
Methods
__construct
Parameters:
Parameter | Type | Description |
---|---|---|
$aggregateId | \Codefy\Domain\Aggregate\AggregateId |
root
-
This method is static.
-
This method is final.
Parameters:
Parameter | Type | Description |
---|---|---|
$aggregateId | \Codefy\Domain\Aggregate\AggregateId |
recordApplyAndPublishThat
Records, applies, and publishes a domain event.
Parameters:
Parameter | Type | Description |
---|---|---|
$event | \Codefy\Domain\EventSourcing\DomainEvent |
applyThat
Parameters:
Parameter | Type | Description |
---|---|---|
$event | \Codefy\Domain\EventSourcing\DomainEvent |
hasRecordedEvents
Determine whether the object's state has changed since the last clearRecordedEvent();
getRecordedEvents
Get all the Domain Events that were recorded since the last time it was cleared, or since it was restored from persistence. This does not include events that were recorded prior.
Throws:
clearRecordedEvents
Clears the record of new Domain Events. This doesn't clear the history of the object.
aggregateId
Returns unique aggregate id.
playhead
Aggregate root version.
reconstituteFromEventStream
Reconstitutes an Aggregate instance from its history of domain events.
public static reconstituteFromEventStream(\Codefy\Domain\EventSourcing\EventStream $aggregateHistory): \Codefy\Domain\Aggregate\RecordsEvents
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$aggregateHistory | \Codefy\Domain\EventSourcing\EventStream |
equals
- This method is final.
Parameters:
Parameter | Type | Description |
---|---|---|
$aggregateRoot | \Codefy\Domain\Aggregate\AggregateRoot |
className
Retrieves the class name.
-
This method is static.
-
This method is final.
Inherited methods
publishThat
Parameters:
Parameter | Type | Description |
---|---|---|
$event | \Codefy\Domain\EventSourcing\DomainEvent |
aggregateId
- This method is abstract.
recordThat
Records domain events.
Parameters:
Parameter | Type | Description |
---|---|---|
$event | \Codefy\Domain\EventSourcing\DomainEvent |
pullDomainEvents
when
- This method is abstract.
Parameters:
Parameter | Type | Description |
---|---|---|
$event | \Codefy\Domain\EventSourcing\DomainEvent |
Automatically generated on 2025-10-13