|
Elgg
Version 2.3
|
Public Member Functions | |
| 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 | REG_KEY_PRIORITY = 0 |
| const | REG_KEY_INDEX = 1 |
| const | REG_KEY_HANDLER = 2 |
Protected Member Functions | |
| getMatcher ($spec) | |
| Create a matcher for the given callable (if it's for a static or dynamic method) More... | |
Protected Attributes | |
| $logger | |
Definition at line 15 of file HooksRegistrationService.php.
| Elgg\HooksRegistrationService::backup | ( | ) |
| Elgg\HooksRegistrationService::clearHandlers | ( | $name, | |
| $type | |||
| ) |
Clears all handlers for a specific hook.
| string | $name | |
| string | $type |
Definition at line 124 of file HooksRegistrationService.php.
| Elgg\HooksRegistrationService::getAllHandlers | ( | ) |
Returns all registered handlers as array( $name => array( $type => array( $priority => array( callback, callback, ) ) )
@access private
Definition at line 142 of file HooksRegistrationService.php.
|
protected |
Create a matcher for the given callable (if it's for a static or dynamic method)
| callable | $spec | Callable we're creating a matcher for |
Definition at line 230 of file HooksRegistrationService.php.
| Elgg\HooksRegistrationService::getOrderedHandlers | ( | $name, | |
| $type | |||
| ) |
Returns an ordered array of handlers registered for $name and $type.
| string | $name | The name of the hook |
| string | $type | The type of the hook |
@access private
Definition at line 181 of file HooksRegistrationService.php.
| Elgg\HooksRegistrationService::hasHandler | ( | $name, | |
| $type | |||
| ) |
Is a handler registered for this specific name and type? "all" handlers are not considered.
If you need to consider "all" handlers, you must check them independently, or use (bool)elgg_get_ordered_hook_handlers().
| string | $name | The name of the hook |
| string | $type | The type of the hook |
Definition at line 167 of file HooksRegistrationService.php.
| Elgg\HooksRegistrationService::registerHandler | ( | $name, | |
| $type, | |||
| $callback, | |||
$priority = 500 |
|||
| ) |
Registers a handler.
@access private
Reimplemented in Elgg\PluginHooksService, and Elgg\EventsService.
Definition at line 60 of file HooksRegistrationService.php.
| Elgg\HooksRegistrationService::restore | ( | ) |
Restore backed up event/hook registrations (after tests)
Definition at line 276 of file HooksRegistrationService.php.
| Elgg\HooksRegistrationService::setLogger | ( | \Elgg\Logger | $logger = null | ) |
Set a logger instance, e.g.
for reporting uncallable handlers
| \Elgg\Logger | $logger | The logger |
Definition at line 47 of file HooksRegistrationService.php.
| Elgg\HooksRegistrationService::unregisterHandler | ( | $name, | |
| $type, | |||
| $callback | |||
| ) |
Unregister a handler.
| string | $name | |
| string | $type | |
| callable | $callback |
Definition at line 85 of file HooksRegistrationService.php.
|
protected |
Definition at line 39 of file HooksRegistrationService.php.
| const Elgg\HooksRegistrationService::REG_KEY_HANDLER = 2 |
Definition at line 19 of file HooksRegistrationService.php.
| const Elgg\HooksRegistrationService::REG_KEY_INDEX = 1 |
Definition at line 18 of file HooksRegistrationService.php.
| const Elgg\HooksRegistrationService::REG_KEY_PRIORITY = 0 |
Definition at line 17 of file HooksRegistrationService.php.