InitiatingEventMetadata
final class InitiatingEventMetadata (View source)
| internal |
Constants
| INITIATING_USER_ID |
|
| INITIATING_TIMESTAMP |
|
Methods
Add "initiatingUserId" and "initiatingTimestamp" metadata to all events.
No description
No description
Details
static Events
enrichEventsWithInitiatingMetadata(Events $events, UserId $initiatingUserId, DateTimeImmutable $initiatingTimestamp)
Add "initiatingUserId" and "initiatingTimestamp" metadata to all events.
This is done in order to keep information about the original metadata when an event is re-applied during publishing/rebasing "initiatingUserId": The identifier of the user that originally triggered this event. This will never be overridden if it is set once. "initiatingTimestamp": The timestamp of the original event. The "recordedAt" timestamp will always be re-created and reflects the time an event was actually persisted in a stream, the "initiatingTimestamp" will be kept and is never overridden again.
static DateTimeImmutable|null
getInitiatingTimestamp(EventMetadata $eventMetadata)
No description
static EventMetadata
extractInitiatingMetadata(EventMetadata $eventMetadata)
No description