\Disco\classesEvent

Event class.

Implements a Broadcast/Receiver pattern.

Summary

Methods
Properties
Constants
listen()
fire()
$defaultMethod
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$events
N/A

Properties

$defaultMethod

$defaultMethod : string

Type

string — Default method to call on objects.

$events

$events : array

Type

array — Events to listen for.

Methods

listen()

listen(string  $event, \Closure|string  $action, integer  $priority) : void

Register an event name with an associated action.

Parameters

string $event

Name of the event.

\Closure|string $action

\Closure or class/method to execute denoted like 'Worker@work'.

integer $priority

The priority of event.

fire()

fire(string  $event, mixed  $data = null) : void

Fire off a registered event.

Parameters

string $event

Name of the event to fire.

mixed $data

The data to be passed to the \Closure or Class method pair.