\LiftKit\Application\HookHook

Abstract Hook type

This class defines an abstract Hook type. A Hook is a container around a set of callbacks. When the hook is triggered

Summary

Methods
Properties
Constants
bind()
release()
trigger()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

bind()

bind(callable  $function, integer  $precedence) : void

Assigns new hook for a given action

Optional precedence may be assigned.

Parameters

callable $function
integer $precedence

(default: 0)

release()

release(mixed  $precedence = null) : void

Releases callbacks which have already been bound

May be done for all callbacks, individual precedence levels for an given hook.

Parameters

mixed $precedence

(default: null) If supplied, will only the callbacks for a given precedence.

trigger()

trigger(mixed  $value, mixed  $precedence = null) : mixed

Invokes all hooks of a given precedence for a given event.

The implementation will determine the exact behavior of how the callbacks interact.

Parameters

mixed $value
mixed $precedence

(default: null)

Returns

mixed