PHP Class Neos\Neos\EventLog\Domain\Service\EventEmittingService

- TODO: explain Nested events
Afficher le fichier Open project: neos/neos-development-collection Class Usage Examples

Protected Properties

Свойство Type Description
$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

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
getCurrentContext ( ) : Event | null The current context-event or NULL if none exists currently.

Method Details

add() public méthode

This only happens for top-level-events. All events which are attached to some parent event are persisted together with the parent.
See also: emit()
public add ( Event $nodeEvent ) : void
$nodeEvent Neos\Neos\EventLog\Domain\Model\Event
Résultat void

emit() public méthode

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
Résultat Neos\Neos\EventLog\Domain\Model\Event

generate() public méthode

Note: Make sure to call add($event) afterwards.
See also: emit()
public generate ( string $eventType, array $data, string $eventClassName = Event::class ) : Event
$eventType string
$data array
$eventClassName string
Résultat Neos\Neos\EventLog\Domain\Model\Event

getCurrentContext() protected méthode

The current context-event or NULL if none exists currently.
protected getCurrentContext ( ) : Event | null
Résultat Neos\Neos\EventLog\Domain\Model\Event | null

isEnabled() public méthode

public isEnabled ( ) : boolean
Résultat boolean TRUE if the event log is enabled and events should be captured

popContext() public méthode

Remove an element from the context stack. Is the reverse operation to pushContext().
public popContext ( ) : void
Résultat void

pushContext() public méthode

Push the last-generated event onto the context, nesting all further generated events underneath the top-level one.
public pushContext ( ) : void
Résultat void

setCurrentAccountIdentifier() public méthode

Set the current account identifier
public setCurrentAccountIdentifier ( string $accountIdentifier ) : void
$accountIdentifier string
Résultat void

Property Details

$currentAccountIdentifier protected_oe property

protected string $currentAccountIdentifier
Résultat string

$enabled protected_oe property

protected bool $enabled
Résultat boolean

$eventContext protected_oe property

If the stack is empty, the events are created top-level.
protected array $eventContext
Résultat array

$eventRepository protected_oe property

protected EventRepository,Neos\Neos\EventLog\Domain\Repository $eventRepository
Résultat Neos\Neos\EventLog\Domain\Repository\EventRepository

$lastGeneratedEvent protected_oe property

a reference to the last-generated event
protected Event,Neos\Neos\EventLog\Domain\Model $lastGeneratedEvent
Résultat Neos\Neos\EventLog\Domain\Model\Event