\PhileEvent

the Event class for implementing a hook/event system

Summary

Methods
Properties
Constants
getInstance()
setInstance()
registerEvent()
triggerEvent()
register()
trigger()
No public properties found
No constants found
No protected methods found
$instance
$registry
N/A
No private methods found
No private properties found
N/A

Properties

$registry

$registry :array

Registry object provides storage for objects.

Type

array

Methods

getInstance()

getInstance(): \Phile\Core\Event

get global event instance

Returns

\Phile\Core\Event

setInstance()

setInstance(\Phile\Core\Event  $instance): void

Set global event instance

Parameters

\Phile\Core\Event $instance

registerEvent()

registerEvent(string  $eventName,\Phile\Gateway\EventObserverInterface|callable  $object): void

Global register

Parameters

string $eventName
\Phile\Gateway\EventObserverInterface|callable $object

observer

triggerEvent()

triggerEvent(string  $eventName,array  $data = null): void

Global trigger

Parameters

string $eventName
array $data

register()

register(string  $eventName,\Phile\Gateway\EventObserverInterface|callable  $object)

method to register an event

Parameters

string $eventName

the event to observe

\Phile\Gateway\EventObserverInterface|callable $object

observer

trigger()

trigger(string  $eventName,array  $data = null)

method to trigger an event

Parameters

string $eventName

the event name (register for this name)

array $data

array with some additional data