\TriTan\Common\HooksApplyFilterHook

Hooks API: Hook Class

Summary

Methods
Properties
Constants
__construct()
apply()
applyRefArray()
current()
$all
$action
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$all

$all : object

Type

object

$action

$action : object

Type

object

Methods

__construct()

__construct(\TriTan\Interfaces\CallAllHookInterface  $all, \TriTan\Interfaces\CurrentFilterHookInterface  $action) 

Parameters

\TriTan\Interfaces\CallAllHookInterface $all
\TriTan\Interfaces\CurrentFilterHookInterface $action

apply()

apply(string  $hook, mixed  $value) : mixed

Performs a filtering operation on a PM element or event.

Typical use:

1) Modify a variable if a function is attached to hook 'hook' $var = "default value"; $var = $this->apply( 'hook', $var );

2) Trigger functions is attached to event $this->apply( 'event' ); (see DoActionHook::do() )

Returns an element which may have been filtered by a filter.

Parameters

string $hook

The name of the the element or action

mixed $value

The value of the element before filtering

Returns

mixed

applyRefArray()

applyRefArray(string  $tag, array  $args) : mixed

Execute functions/methods hooked on a specific filter hook, specifying arguments in an array.

Parameters

string $tag

The name of the filter hook.

array $args

The arguments supplied to the functions/methods hooked to $tag

Returns

mixed —

The filtered value after all hooked functions/methods are applied to it.

current()

current() : string

Retrieve the name of the current action.

Returns

string —

Hook name of the current action.