Elgg  Version 1.9
Public Member Functions | Protected 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...
 

Protected Member Functions

 getOrderedHandlers ($name, $type)
 Returns an ordered array of handlers registered for $name and $type. More...
 
 describeCallable ($callable)
 Get a string description of a callback. More...
 

Protected Attributes

 $logger
 

Detailed Description

Definition at line 14 of file HooksRegistrationService.php.

Member Function Documentation

Elgg_HooksRegistrationService::describeCallable (   $callable)
protected

Get a string description of a callback.

E.g. "function_name", "Static::method", "(ClassName)->method", "(Closure path/to/file.php:23)"

Parameters
mixed$callableThe callable value to describe
Returns
string

Definition at line 158 of file HooksRegistrationService.php.

Elgg_HooksRegistrationService::getAllHandlers ( )

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

) )

private

Returns
array

Definition at line 102 of file HooksRegistrationService.php.

Elgg_HooksRegistrationService::getOrderedHandlers (   $name,
  $type 
)
protected

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
Elgg_HooksRegistrationService::getAllHandlers()

Definition at line 125 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 113 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 42 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 29 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 78 of file HooksRegistrationService.php.

Member Data Documentation

Elgg_HooksRegistrationService::$logger
protected

Definition at line 21 of file HooksRegistrationService.php.


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