\Drupal\strata\Event StrataEvent

Base for every event this module dispatches.

Two things every subscriber needs and neither Symfony's Event nor Drupal's supplies: the name the event was dispatched under, so one listener can serve several names, and a JSON body, so a webhook does not have to know the concrete class to render a payload.

The payload is built once and cached, because a webhook dispatcher renders it for every matching subscription and a site can have several.

Summary

Methods
Properties
Constants
name
jsonSerialize
No public properties found
No public constants found
body
No protected properties found
No protected constants found
No private methods found
rendered
No private constants found

Properties

$rendered

$rendered : array|null

The rendered payload, once built.

Type

array<string, mixed>|null —

Methods

name()

name() : string

The name this event is dispatched under.

Returns

string —

One of the constants on StrataEvents.

jsonSerialize()

jsonSerialize() : array<string,mixed>

The payload a webhook sends and a log line records.

Returns

array

The event name, the site, the moment, and the body.

body()

body() : array<string,mixed>

What happened, as data.

Returns

array

The body, without the envelope.