\PhugEventManagerInterface

Interface for EventManager.

Summary

Methods
Constants
getEventListeners()
mergeEventListeners()
attach()
detach()
clearListeners()
trigger()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

getEventListeners()

getEventListeners() : array<mixed,\Phug\Event\ListenerQueue>

Returns current event listeners by event name.

Returns

array<mixed,\Phug\Event\ListenerQueue>

mergeEventListeners()

mergeEventListeners(array<mixed,\Phug\Event\ListenerQueue>  $eventListeners) : boolean

Merge current events listeners with a given list.

Parameters

array<mixed,\Phug\Event\ListenerQueue> $eventListeners

event listeners by event name

Returns

boolean —

true on success false on failure

attach()

attach(string  $event, callable  $callback, integer  $priority) : boolean

Attaches a listener to an event.

Parameters

string $event

the event to attach too

callable $callback

a callable function

integer $priority

the priority at which the $callback executed

Returns

boolean —

true on success false on failure

detach()

detach(string  $event, callable  $callback) : boolean

Detaches a listener from an event.

Parameters

string $event

the event to attach too

callable $callback

a callable function

Returns

boolean —

true on success false on failure

clearListeners()

clearListeners(string  $event) : void

Clear all listeners for a given event.

Parameters

string $event

trigger()

trigger(string|\Phug\EventInterface  $event, object|string  $target = null, array|object  $argv = array()) : mixed

Trigger an event.

Can accept an EventInterface or will create one if not passed

Parameters

string|\Phug\EventInterface $event
object|string $target
array|object $argv

Returns

mixed