Elgg
Version 2.3
|
Public Member Functions | |
__construct (Inspector $inspector=null) | |
Constructor. More... | |
registerHandler ($name, $type, $callback, $priority=500) | |
{} More... | |
trigger ($event, $type, $object=null, array $options=array()) | |
Triggers an Elgg event. More... | |
triggerBefore ($event, $object_type, $object=null) | |
Trigger a "Before event" indicating a process is about to begin. More... | |
triggerAfter ($event, $object_type, $object=null) | |
Trigger an "After event" indicating a process has finished. More... | |
triggerDeprecated ($event, $object_type, $object=null, $message, $version) | |
Trigger an event normally, but send a notice about deprecated use if any handlers are registered. More... | |
Public Member Functions inherited from Elgg\HooksRegistrationService | |
setLogger (\Elgg\Logger $logger=null) | |
Set a logger instance, e.g. More... | |
registerHandler ($name, $type, $callback, $priority=500) | |
Registers a handler. More... | |
unregisterHandler ($name, $type, $callback) | |
Unregister a handler. More... | |
clearHandlers ($name, $type) | |
Clears all handlers for a specific hook. More... | |
getAllHandlers () | |
Returns all registered handlers as array( $name => array( $type => array( $priority => array( callback, callback, ) ) ) More... | |
hasHandler ($name, $type) | |
Is a handler registered for this specific name and type? "all" handlers are not considered. More... | |
getOrderedHandlers ($name, $type) | |
Returns an ordered array of handlers registered for $name and $type. More... | |
backup () | |
Temporarily remove all event/hook registrations (before tests) More... | |
restore () | |
Restore backed up event/hook registrations (after tests) More... | |
Public Attributes | |
const | OPTION_STOPPABLE = 'stoppable' |
const | OPTION_DEPRECATION_MESSAGE = 'deprecation_message' |
const | OPTION_DEPRECATION_VERSION = 'deprecation_version' |
Public Attributes inherited from Elgg\HooksRegistrationService | |
const | REG_KEY_PRIORITY = 0 |
const | REG_KEY_INDEX = 1 |
const | REG_KEY_HANDLER = 2 |
Additional Inherited Members | |
Protected Member Functions inherited from Elgg\HooksRegistrationService | |
getMatcher ($spec) | |
Create a matcher for the given callable (if it's for a static or dynamic method) More... | |
Protected Attributes inherited from Elgg\HooksRegistrationService | |
$logger | |
Definition at line 14 of file EventsService.php.
Elgg\EventsService::__construct | ( | Inspector | $inspector = null | ) |
Constructor.
Inspector | $inspector | Inspector |
Definition at line 31 of file EventsService.php.
Elgg\EventsService::registerHandler | ( | $name, | |
$type, | |||
$callback, | |||
$priority = 500 |
|||
) |
{}
Definition at line 41 of file EventsService.php.
Elgg\EventsService::trigger | ( | $event, | |
$type, | |||
$object = null , |
|||
array | $options = array() |
||
) |
Triggers an Elgg event.
Definition at line 78 of file EventsService.php.
Elgg\EventsService::triggerAfter | ( | $event, | |
$object_type, | |||
$object = null |
|||
) |
Trigger an "After event" indicating a process has finished.
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.
string | $event | The event type. The fired event type will be appended with ":after". |
string | $object_type | The object type |
string | $object | The object involved in the event |
Definition at line 162 of file EventsService.php.
Elgg\EventsService::triggerBefore | ( | $event, | |
$object_type, | |||
$object = null |
|||
) |
Trigger a "Before event" indicating a process is about to begin.
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.
string | $event | The event type. The fired event type will be appended with ":before". |
string | $object_type | The object type |
string | $object | The object involved in the event |
Definition at line 142 of file EventsService.php.
Elgg\EventsService::triggerDeprecated | ( | $event, | |
$object_type, | |||
$object = null , |
|||
$message, | |||
$version | |||
) |
Trigger an event normally, but send a notice about deprecated use if any handlers are registered.
string | $event | The event type |
string | $object_type | The object type |
string | $object | The object involved in the event |
string | $message | The deprecation message |
string | $version | Human-readable release version: 1.9, 1.10, ... |
Definition at line 182 of file EventsService.php.
const Elgg\EventsService::OPTION_DEPRECATION_MESSAGE = 'deprecation_message' |
Definition at line 18 of file EventsService.php.
const Elgg\EventsService::OPTION_DEPRECATION_VERSION = 'deprecation_version' |
Definition at line 19 of file EventsService.php.
const Elgg\EventsService::OPTION_STOPPABLE = 'stoppable' |
Definition at line 17 of file EventsService.php.