final class Events implements IteratorAggregate, Countable (View source)

internal  only used during event publishing (from within command handlers) - and their implementation is not API
 

A set of Content Repository "domain events", part of {EventsToPublish}

For better type checking we ensure that this collection is never empty. That is because {\Neos\EventStore\EventStoreInterface::commit()} will throw an exception if there are 0 events passed:

Writable events must contain at least one event

We do not skip the case for 0 events to ensure each command always maps to a mutation. Forgiving noop behaviour is not intended for this low level code.

Properties

EventInterface|DecoratedEvent> $items

Methods

static Events
with(EventInterface|DecoratedEvent $event)

No description

withAppendedEvents(Events $events)

No description

static Events
fromArray(array $events)

No description

getIterator()

No description

array
map(Closure $callback)

No description

toInnerEvents()

No description

int
count()

No description

Details

static Events with(EventInterface|DecoratedEvent $event)

No description

Parameters

EventInterface|DecoratedEvent $event

Return Value

Events

Events withAppendedEvents(Events $events)

No description

Parameters

Events $events

Return Value

Events

static Events fromArray(array $events)

No description

Parameters

array $events

Return Value

Events

Traversable getIterator()

No description

Return Value

Traversable

array map(Closure $callback)

No description

Parameters

Closure $callback

Return Value

array

PublishedEvents toInnerEvents()

No description

Return Value

PublishedEvents

int count()

No description

Return Value

int