Elgg  Version 3.0
Public Member Functions | Public Attributes | List of all members
Elgg\HooksRegistrationService\Hook Class Reference

The object passed to invokable class name handlers. More...

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

Public Member Functions

 __construct (PublicContainer $dic, $name, $type, $value, $params)
 Constructor. More...
 
 getName ()
 {Get the name of the hook.
Returns
string
} More...
 
 getType ()
 {Get the type of the hook.
Returns
string
} More...
 
 getValue ()
 {Get the current value of the hook.
Returns
mixed
} More...
 
 setValue ($value)
 Update the value. More...
 
 getParams ()
 {Get the parameters passed to the trigger call.
Returns
mixed
} More...
 
 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
} More...
 
 getEntityParam ()
 {Gets the "entity" key from the params if it holds an Elgg entity.
Returns
|null
} More...
 
 getUserParam ()
 {Gets the "user" key from the params if it holds an Elgg user.
Returns
|null
} More...
 
 elgg ()
 {Get the DI container.
Returns
PublicContainer
} More...
 
 toLegacyArgs ()
 

Public Attributes

const EVENT_TYPE = 'hook'
 

Detailed Description

The object passed to invokable class name handlers.

Definition at line 12 of file Hook.php.

Constructor & Destructor Documentation

Elgg\HooksRegistrationService\Hook::__construct ( PublicContainer  $dic,
  $name,
  $type,
  $value,
  $params 
)

Constructor.

Parameters
PublicContainer$dicDI container
string$nameHook name
string$typeHook type
mixed$valueHook value
mixed$paramsHook params

Definition at line 31 of file Hook.php.

Member Function Documentation

Elgg\HooksRegistrationService\Hook::elgg ( )

{Get the DI container.

Returns
PublicContainer
}

Implements Elgg\Hook.

Definition at line 115 of file Hook.php.

Elgg\HooksRegistrationService\Hook::getEntityParam ( )

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

Returns
|null
}

Implements Elgg\Hook.

Definition at line 93 of file Hook.php.

Elgg\HooksRegistrationService\Hook::getName ( )

{Get the name of the hook.

Returns
string
}

Implements Elgg\Hook.

Definition at line 42 of file Hook.php.

Elgg\HooksRegistrationService\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
}

Implements Elgg\Hook.

Definition at line 82 of file Hook.php.

Elgg\HooksRegistrationService\Hook::getParams ( )

{Get the parameters passed to the trigger call.

Returns
mixed
}

Implements Elgg\Hook.

Definition at line 75 of file Hook.php.

Elgg\HooksRegistrationService\Hook::getType ( )

{Get the type of the hook.

Returns
string
}

Implements Elgg\Hook.

Definition at line 49 of file Hook.php.

Elgg\HooksRegistrationService\Hook::getUserParam ( )

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

Returns
|null
}

Implements Elgg\Hook.

Definition at line 104 of file Hook.php.

Elgg\HooksRegistrationService\Hook::getValue ( )

{Get the current value of the hook.

Returns
mixed
}

Implements Elgg\Hook.

Definition at line 56 of file Hook.php.

Elgg\HooksRegistrationService\Hook::setValue (   $value)

Update the value.

Parameters
mixed$valueThe new value
Returns
void

Definition at line 68 of file Hook.php.

Elgg\HooksRegistrationService\Hook::toLegacyArgs ( )
Returns
array

Definition at line 122 of file Hook.php.

Member Data Documentation

const Elgg\HooksRegistrationService\Hook::EVENT_TYPE = 'hook'

Definition at line 20 of file Hook.php.


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