PHP Класс Pheasant\Events

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( $handlers = [], $upstream = null ) Construct
__invoke ( $event, $object )
cork ( ) Prevent events from firing until uncork() is called
discard ( ) Discards any events queued with cork()
register ( $event, $callback ) Registers a handler for an event
trigger ( $event, $object ) Triggers an event against the registered handlers
uncork ( ) Execute events that have been queued since cork() was called
unregister ( $event = null ) Unregisters an event handler based on event, or all
wrap ( $event, $object, $callback ) Execute a closure, trigger a before{$event} and after{$event}

Приватные методы

Метод Описание
_callbacksFor ( $event )

Описание методов

__construct() публичный Метод

Construct
public __construct ( $handlers = [], $upstream = null )

__invoke() публичный Метод

См. также: http://www.php.net/manual/en/language.oop5.magic.php#object.invoke
public __invoke ( $event, $object )

cork() публичный Метод

Prevent events from firing until uncork() is called
public cork ( )

discard() публичный Метод

Discards any events queued with cork()
public discard ( )

register() публичный Метод

Registers a handler for an event
public register ( $event, $callback )

trigger() публичный Метод

Triggers an event against the registered handlers
public trigger ( $event, $object )

uncork() публичный Метод

Execute events that have been queued since cork() was called
public uncork ( )

unregister() публичный Метод

Unregisters an event handler based on event, or all
public unregister ( $event = null )

wrap() публичный Метод

Execute a closure, trigger a before{$event} and after{$event}
public wrap ( $event, $object, $callback )