Elgg
Version 4.3
|
Public Member Functions | |
__construct (EventsService $events) | |
Constructor. More... | |
trigger ($name, $type, $params=null, $value=null, array $options=[]) | |
Triggers a plugin hook. More... | |
triggerDeprecated ($name, $type, $params=null, $value=null, $message=null, $version=null) | |
Trigger an plugin hook normally, but send a notice about deprecated use if any handlers are registered. More... | |
registerHandler ($name, $type, $callback, $priority=500) | |
{} More... | |
unregisterHandler ($name, $type, $callback) | |
![]() | |
registerHandler ($name, $type, $callback, $priority=500) | |
Register a callback as a plugin hook handler. More... | |
unregisterHandler ($name, $type, $callback) | |
Unregister a callback as a plugin hook of event handler. More... | |
clearHandlers ($name, $type) | |
Clears all callback registrations for a plugin 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... | |
Additional Inherited Members | |
![]() | |
const | REG_KEY_PRIORITY = 0 |
const | REG_KEY_INDEX = 1 |
const | REG_KEY_HANDLER = 2 |
const | OPTION_DEPRECATION_MESSAGE = 'deprecation_message' |
const | OPTION_DEPRECATION_VERSION = 'deprecation_version' |
![]() | |
getMatcher ($spec) | |
Create a matcher for the given callable (if it's for a static or dynamic method) More... | |
checkDeprecation ($name, $type, array $options=[]) | |
Check if handlers are registered on a deprecated hook/event. More... | |
Elgg\PluginHooksService::__construct | ( | EventsService | $events | ) |
Constructor.
EventsService | $events | Events |
Definition at line 23 of file PluginHooksService.php.
Elgg\PluginHooksService::registerHandler | ( | $name, | |
$type, | |||
$callback, | |||
$priority = 500 |
|||
) |
{}
Definition at line 117 of file PluginHooksService.php.
Elgg\PluginHooksService::trigger | ( | $name, | |
$type, | |||
$params = null , |
|||
$value = null , |
|||
array | $options = [] |
||
) |
Triggers a plugin hook.
string | $name | The name of the plugin hook |
string | $type | The type of the plugin hook |
mixed | $params | Supplied params for the hook |
mixed | $value | The value of the hook, this can be altered by registered callbacks |
array | $options | (internal) options for triggering the plugin hook |
Definition at line 40 of file PluginHooksService.php.
Elgg\PluginHooksService::triggerDeprecated | ( | $name, | |
$type, | |||
$params = null , |
|||
$value = null , |
|||
$message = null , |
|||
$version = null |
|||
) |
Trigger an plugin hook normally, but send a notice about deprecated use if any handlers are registered.
string | $name | The name of the plugin hook |
string | $type | The type of the plugin hook |
mixed | $params | Supplied params for the hook |
mixed | $value | The value of the hook, this can be altered by registered callbacks |
string | $message | The deprecation message |
string | $version | Human-readable release version: 1.9, 1.10, ... |
Definition at line 105 of file PluginHooksService.php.
Elgg\PluginHooksService::unregisterHandler | ( | $name, | |
$type, | |||
$callback | |||
) |
Definition at line 128 of file PluginHooksService.php.