Skip to content

DomainEvent

Something that happened in the past and that is of importance to the business.


  • Full name: \Codefy\Domain\EventSourcing\DomainEvent

Methods

aggregateId

The ID of the Aggregate this event belongs to.

public aggregateId(): \Codefy\Domain\Aggregate\AggregateId

recordedAt

Date the event was recorded on.

public recordedAt(): ?\DateTimeInterface

withPlayhead

Append event version.

public withPlayhead(int $playhead): self

Parameters:

Parameter Type Description
$playhead int

playhead

Version of the recorded event.

public playhead(): int

payload

Returns payload array.

public payload(): array

eventType

Name of the event.

public eventType(): string

eventId

Uuid of the event.

public eventId(): \Codefy\Domain\EventSourcing\EventId

metadata

Event metadata.

public metadata(): array

metaParam

Retrieve meta data from metadata by name.

public metaParam(string $name, mixed $default = null): mixed

Parameters:

Parameter Type Description
$name string
$default mixed