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.
Method Summary
- 
          getData() publicAccesses the event data/payload. 
- 
          getName() publicReturns the name of this event. This is usually used as the event identifier. 
- 
          getResult() publicThe result value of the event listeners. 
- 
          getSubject() publicReturns the subject of this event. 
- 
          isStopped() publicChecks if the event is stopped. 
- 
          setData() publicAssigns a value to the data/payload of this event. 
- 
          setResult() publicListeners can attach a result value to the event. 
- 
          stopPropagation() publicStops the event from being used anymore. 
Method Detail
getData() ¶ public
getData(string|null $key = null): array|mixed|nullAccesses the event data/payload.
Parameters
- 
                string|null$key optional
- The data payload element to return, or null to return all data. 
Returns
array|mixed|nullThe 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(): stringReturns the name of this event. This is usually used as the event identifier.
Returns
stringisStopped() ¶ public
isStopped(): boolChecks if the event is stopped.
Returns
boolTrue if the event is stopped
setData() ¶ public
setData(array|string $key, mixed $value = null): $thisAssigns 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
- The value to set. 
Returns
$thissetResult() ¶ public
setResult(mixed $value = null): $thisListeners can attach a result value to the event.
Parameters
- 
                mixed$value optional
- The value to set. 
Returns
$thisstopPropagation() ¶ public
stopPropagation(): voidStops the event from being used anymore.
Returns
void