Elgg  Version 3.0
Public Member Functions | List of all members
Elgg\Hook Interface Reference

Models an event passed to hook handlers. More...

Inheritance diagram for Elgg\Hook:
Elgg\HooksRegistrationService\Hook

Public Member Functions

 getName ()
 Get the name of the hook. More...
 
 getType ()
 Get the type of the hook. More...
 
 getValue ()
 Get the current value of the hook. More...
 
 getParams ()
 Get the parameters passed to the trigger call. More...
 
 getParam ($key, $default=null)
 Get an element of the params array. More...
 
 getEntityParam ()
 Gets the "entity" key from the params if it holds an Elgg entity. More...
 
 getUserParam ()
 Gets the "user" key from the params if it holds an Elgg user. More...
 
 elgg ()
 Get the DI container. More...
 

Detailed Description

Models an event passed to hook handlers.

Since
2.0.0

Definition at line 12 of file Hook.php.

Member Function Documentation

Elgg\Hook::elgg ( )

Get the DI container.

Returns
PublicContainer

Implemented in Elgg\HooksRegistrationService\Hook.

Elgg\Hook::getEntityParam ( )

Gets the "entity" key from the params if it holds an Elgg entity.

Returns
|null

Implemented in Elgg\HooksRegistrationService\Hook.

Elgg\Hook::getName ( )

Get the name of the hook.

Returns
string

Implemented in Elgg\HooksRegistrationService\Hook.

Elgg\Hook::getParam (   $key,
  $default = null 
)

Get an element of the params array.

If the params array is not an array, the default will always be returned.

Parameters
string$keyThe key of the value in the params array
mixed$defaultThe value to return if missing
Returns
mixed

Implemented in Elgg\HooksRegistrationService\Hook.

Elgg\Hook::getParams ( )

Get the parameters passed to the trigger call.

Returns
mixed

Implemented in Elgg\HooksRegistrationService\Hook.

Elgg\Hook::getType ( )

Get the type of the hook.

Returns
string

Implemented in Elgg\HooksRegistrationService\Hook.

Elgg\Hook::getUserParam ( )

Gets the "user" key from the params if it holds an Elgg user.

Returns
|null

Implemented in Elgg\HooksRegistrationService\Hook.

Elgg\Hook::getValue ( )

Get the current value of the hook.

Returns
mixed

Implemented in Elgg\HooksRegistrationService\Hook.


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