PHP Класс Elgg\EventsService

С версии: 1.9.0
Наследование: extends HooksRegistrationService, use trait Profilable
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__construct ( Inspector $inspector = null ) Constructor
registerHandler ( $name, $type, $callback, $priority = 500 )
trigger ( $event, $type, $object = null, array $options = [] ) Triggers an Elgg event.
triggerAfter ( string $event, string $object_type, string $object = null ) : true Trigger an "After event" indicating a process has finished.
triggerBefore ( string $event, string $object_type, string $object = null ) : boolean Trigger a "Before event" indicating a process is about to begin.
triggerDeprecated ( string $event, string $object_type, string $object = null, string $message, string $version ) : boolean Trigger an event normally, but send a notice about deprecated use if any handlers are registered.

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

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

Constructor
public __construct ( Inspector $inspector = null )
$inspector Elgg\Debug\Inspector Inspector

registerHandler() публичный метод

public registerHandler ( $name, $type, $callback, $priority = 500 )

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

Triggers an Elgg event.
См. также: elgg_trigger_event
См. также: elgg_trigger_after_event
public trigger ( $event, $type, $object = null, array $options = [] )
$options array

triggerAfter() публичный метод

Unlike regular events, all the handlers will be called, their return values ignored. To register for an after event, append ":after" to the event name when registering.
См. также: triggerBefore
С версии: 2.0.0
public triggerAfter ( string $event, string $object_type, string $object = null ) : true
$event string The event type. The fired event type will be appended with ":after".
$object_type string The object type
$object string The object involved in the event
Результат true

triggerBefore() публичный метод

Like regular events, a handler returning false will cancel the process and false will be returned. To register for a before event, append ":before" to the event name when registering.
См. также: trigger
См. также: triggerAfter
С версии: 2.0.0
public triggerBefore ( string $event, string $object_type, string $object = null ) : boolean
$event string The event type. The fired event type will be appended with ":before".
$object_type string The object type
$object string The object involved in the event
Результат boolean False if any handler returned false, otherwise true

triggerDeprecated() публичный метод

Trigger an event normally, but send a notice about deprecated use if any handlers are registered.
См. также: trigger
public triggerDeprecated ( string $event, string $object_type, string $object = null, string $message, string $version ) : boolean
$event string The event type
$object_type string The object type
$object string The object involved in the event
$message string The deprecation message
$version string Human-readable *release* version: 1.9, 1.10, ...
Результат boolean