interface Dispatcher (View source)

Methods

void
listen( string|array $events, mixed $listener, int $priority)

Register an event listener with the dispatcher.

bool
hasListeners( string $eventName)

Determine if a given event has listeners.

void
push( string $event, array $payload = array())

Register an event and payload to be fired later.

void
subscribe( object|string $subscriber)

Register an event subscriber with the dispatcher.

mixed
until( string $event, array $payload = array())

Fire an event until the first non-null response is returned.

void
flush( string $event)

Flush a set of pushed events.

array|null
fire( string|object $event, mixed $payload = array(), bool $halt = false)

Fire an event and call the listeners.

string
firing()

Get the event that is currently firing.

void
forget( string $event)

Remove a set of listeners from the dispatcher.

void
forgetPushed()

Forget all of the queued listeners.

Details

at line line 15
void listen( string|array $events, mixed $listener, int $priority)

Register an event listener with the dispatcher.

Parameters

string|array $events
mixed $listener
int $priority

Return Value

void

at line line 23
bool hasListeners( string $eventName)

Determine if a given event has listeners.

Parameters

string $eventName

Return Value

bool

at line line 32
void push( string $event, array $payload = array())

Register an event and payload to be fired later.

Parameters

string $event
array $payload

Return Value

void

at line line 40
void subscribe( object|string $subscriber)

Register an event subscriber with the dispatcher.

Parameters

object|string $subscriber

Return Value

void

at line line 49
mixed until( string $event, array $payload = array())

Fire an event until the first non-null response is returned.

Parameters

string $event
array $payload

Return Value

mixed

at line line 57
void flush( string $event)

Flush a set of pushed events.

Parameters

string $event

Return Value

void

at line line 67
array|null fire( string|object $event, mixed $payload = array(), bool $halt = false)

Fire an event and call the listeners.

Parameters

string|object $event
mixed $payload
bool $halt

Return Value

array|null

at line line 74
string firing()

Get the event that is currently firing.

Return Value

string

at line line 82
void forget( string $event)

Remove a set of listeners from the dispatcher.

Parameters

string $event

Return Value

void

at line line 89
void forgetPushed()

Forget all of the queued listeners.

Return Value

void