PHP Класс Neos\Neos\EventLog\Domain\Service\EventEmittingService

- TODO: explain Nested events
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$currentAccountIdentifier string
$enabled boolean
$eventContext array If the stack is empty, the events are created top-level.
$eventRepository Neos\Neos\EventLog\Domain\Repository\EventRepository
$lastGeneratedEvent Neos\Neos\EventLog\Domain\Model\Event a reference to the last-generated event

Открытые методы

Метод Описание
add ( Event $nodeEvent ) : void Add the passed event (which has been generated by generate()) to persistence.
emit ( string $eventType, array $data, string $eventClassName = Event::class ) : Event Convenience method for generating an event and directly adding it afterwards to persistence.
generate ( string $eventType, array $data, string $eventClassName = Event::class ) : Event Generates a new event, without persisting it yet.
isEnabled ( ) : boolean
popContext ( ) : void Remove an element from the context stack. Is the reverse operation to pushContext().
pushContext ( ) : void Push the last-generated event onto the context, nesting all further generated events underneath the top-level one.
setCurrentAccountIdentifier ( string $accountIdentifier ) : void Set the current account identifier

Защищенные методы

Метод Описание
getCurrentContext ( ) : Event | null The current context-event or NULL if none exists currently.

Описание методов

add() публичный Метод

This only happens for top-level-events. All events which are attached to some parent event are persisted together with the parent.
См. также: emit()
public add ( Event $nodeEvent ) : void
$nodeEvent Neos\Neos\EventLog\Domain\Model\Event
Результат void

emit() публичный Метод

Convenience method for generating an event and directly adding it afterwards to persistence.
public emit ( string $eventType, array $data, string $eventClassName = Event::class ) : Event
$eventType string
$data array
$eventClassName string
Результат Neos\Neos\EventLog\Domain\Model\Event

generate() публичный Метод

Note: Make sure to call add($event) afterwards.
См. также: emit()
public generate ( string $eventType, array $data, string $eventClassName = Event::class ) : Event
$eventType string
$data array
$eventClassName string
Результат Neos\Neos\EventLog\Domain\Model\Event

getCurrentContext() защищенный Метод

The current context-event or NULL if none exists currently.
protected getCurrentContext ( ) : Event | null
Результат Neos\Neos\EventLog\Domain\Model\Event | null

isEnabled() публичный Метод

public isEnabled ( ) : boolean
Результат boolean TRUE if the event log is enabled and events should be captured

popContext() публичный Метод

Remove an element from the context stack. Is the reverse operation to pushContext().
public popContext ( ) : void
Результат void

pushContext() публичный Метод

Push the last-generated event onto the context, nesting all further generated events underneath the top-level one.
public pushContext ( ) : void
Результат void

setCurrentAccountIdentifier() публичный Метод

Set the current account identifier
public setCurrentAccountIdentifier ( string $accountIdentifier ) : void
$accountIdentifier string
Результат void

Описание свойств

$currentAccountIdentifier защищенное свойство

protected string $currentAccountIdentifier
Результат string

$enabled защищенное свойство

protected bool $enabled
Результат boolean

$eventContext защищенное свойство

If the stack is empty, the events are created top-level.
protected array $eventContext
Результат array

$eventRepository защищенное свойство

protected EventRepository,Neos\Neos\EventLog\Domain\Repository $eventRepository
Результат Neos\Neos\EventLog\Domain\Repository\EventRepository

$lastGeneratedEvent защищенное свойство

a reference to the last-generated event
protected Event,Neos\Neos\EventLog\Domain\Model $lastGeneratedEvent
Результат Neos\Neos\EventLog\Domain\Model\Event