$result
$result : mixed
Property used to retain the result value of the event listeners
Note: Public access is deprecated, use setResult() and getResult() instead.
Class Event
__construct(string $name, object|null $subject = null, array|\ArrayAccess|null $data = null)
Constructor
$event = new Event('Order.afterBuy', $this, ['buyer' => $userData]);
$event = new Event('User.afterRegister', $UserModel);
string | $name | Name of the event |
object|null | $subject | the object that this event applies to (usually the object that is generating the event) |
array|\ArrayAccess|null | $data | any value you wish to be transported with this event to it can be read by listeners |
__set(string $attribute, mixed $value) : void
Provides backward compatibility for write access to data and result properties.
string | $attribute | Attribute name. |
mixed | $value | The value to set. |
None found |
name() : string
Returns the name of this event. This is usually used as the event identifier
None found |
getName() : string
Returns the name of this event. This is usually used as the event identifier
None found |
None found |
None found |
None found |
isStopped() : boolean
Check if the event is stopped
True if the event is stopped
None found |
None found |
None found |
setResult(mixed $value = null) : $this
Listeners can attach a result value to the event.
mixed | $value | The value to set. |
None found |
data(string|null $key = null) : array|mixed|null
Access the event data/payload.
string|null | $key | The data payload element to return, or null to return all data. |
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.
None found |
getData(string|null $key = null) : array|mixed|null
Access the event data/payload.
string|null | $key | The data payload element to return, or null to return all data. |
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.
None found |
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 | The value to set. |
None found |
Loading…