Represents the transport class of events across the system. It receives a name, subject and an optional payload. The name can be any string that uniquely identifies the event across the application, while the subject represents the object that the event applies to.
Accesses the event data/payload.
Returns the name of this event. This is usually used as the event identifier.
The result value of the event listeners.
Returns the subject of this event.
Checks if the event is stopped.
Assigns a value to the data/payload of this event.
Listeners can attach a result value to the event.
Stops the event from being used anymore.
getData(string|null $key = null): mixed|array|null
Accesses the event data/payload.
string|null
$key optional The data payload element to return, or null to return all data.
mixed|array|null
getName(): string
Returns the name of this event. This is usually used as the event identifier.
string
getResult(): mixed
The result value of the event listeners.
mixed
getSubject(): object
Returns the subject of this event.
object
isStopped(): bool
Checks if the event is stopped.
bool
setData(array|string $key, mixed $value = null): $this
Assigns a value to the data/payload of this event.
array|string
$key An array will replace all payload data, and a key will set just that array item.
mixed
$value optional The value to set.
$this
setResult(mixed $value = null): $this
Listeners can attach a result value to the event.
mixed
$value optional The value to set.
$this
stopPropagation(): void
Stops the event from being used anymore.
void
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/interface-Cake.Event.EventInterface.html