Elgg  Version 1.11
Public Member Functions | Protected Attributes | List of all members
Elgg\HooksRegistrationService Class Reference
Inheritance diagram for Elgg\HooksRegistrationService:
Elgg\EventsService Elgg\PluginHooksService

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...
 
 getAllHandlers ()
 Returns all registered handlers as array( $name => array( $type => array( $priority => callback, ... More...
 
 hasHandler ($name, $type)
 Does the hook have a handler? More...
 
 getOrderedHandlers ($name, $type)
 Returns an ordered array of handlers registered for $name and $type. More...
 

Protected Attributes

 $logger
 

Detailed Description

Examples:
/root/Elgg/engine/lib/cache.php, /root/Elgg/engine/lib/output.php, and /root/Elgg/engine/lib/views.php.

Definition at line 15 of file HooksRegistrationService.php.

Member Function Documentation

Elgg\HooksRegistrationService::getAllHandlers ( )

Returns all registered handlers as array( $name => array( $type => array( $priority => callback, ...

) )

private

Returns
array

Definition at line 103 of file HooksRegistrationService.php.

Elgg\HooksRegistrationService::getOrderedHandlers (   $name,
  $type 
)

Returns an ordered array of handlers registered for $name and $type.

Parameters
string$nameThe name of the hook
string$typeThe type of the hook
Returns
array
See also
::getAllHandlers()

private

Definition at line 128 of file HooksRegistrationService.php.

Elgg\HooksRegistrationService::hasHandler (   $name,
  $type 
)

Does the hook have a handler?

Parameters
string$nameThe name of the hook
string$typeThe type of the hook
Returns
boolean

Definition at line 114 of file HooksRegistrationService.php.

Elgg\HooksRegistrationService::registerHandler (   $name,
  $type,
  $callback,
  $priority = 500 
)

Registers a handler.

Warning
This doesn't check if a callback is valid to be called, only if it is in the correct format as a callable.

private

Definition at line 43 of file HooksRegistrationService.php.

Elgg\HooksRegistrationService::setLogger ( \Elgg\Logger  $logger = null)

Set a logger instance, e.g.

for reporting uncallable handlers

Parameters
\Elgg\Logger$loggerThe logger
Returns
self

Definition at line 30 of file HooksRegistrationService.php.

Elgg\HooksRegistrationService::unregisterHandler (   $name,
  $type,
  $callback 
)

Unregister a handler.

Parameters
string$name
string$type
callable$callback
Returns
bool private

Definition at line 79 of file HooksRegistrationService.php.

Member Data Documentation

Elgg\HooksRegistrationService::$logger
protected

Definition at line 22 of file HooksRegistrationService.php.


The documentation for this class was generated from the following file: