Interface EventInterface
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.
Direct Implementers
Magic properties summary
-
$data
publicarray
(deprecated) Custom data for the method that receives the event -
$name
publicstring
(deprecated) Name of the event -
$result
publicmixed
(deprecated) Property used to retain the result value of the event listeners -
$subject
publicobject
(deprecated) The object this event applies to
Method Summary
-
getData() public
Accesses the event data/payload. -
getName() public
Returns the name of this event. This is usually used as the event identifier. -
getResult() public
The result value of the event listeners. -
getSubject() public
Returns the subject of this event. -
isStopped() public
Checks if the event is stopped. -
setData() public
Assigns a value to the data/payload of this event. -
setResult() public
Listeners can attach a result value to the event. -
stopPropagation() public
Stops the event from being used anymore.
Method Detail
getData() public ¶
getData( string|null $key null )
Accesses the event data/payload.
Parameters
- string|null $key optional null
- The data payload element to return, or null to return all data.
Returns
The data payload if $key is null, or the data value for the given $key. If the $key does not exist a null value is returned.
getName() public ¶
getName( )
Returns the name of this event. This is usually used as the event identifier.
Returns
isStopped() public ¶
isStopped( )
Checks if the event is stopped.
Returns
True if the event is stopped
setData() public ¶
setData( array|string $key , mixed $value null )
Assigns a value to the data/payload of this event.
Parameters
- array|string $key
- An array will replace all payload data, and a key will set just that array item.
- mixed $value optional null
- The value to set.
Returns
$this
setResult() public ¶
setResult( mixed $value null )
Listeners can attach a result value to the event.
Parameters
- mixed $value optional null
- The value to set.
Returns
$this