Documentation

Horde_Core_Hooks
in package

Runs Horde application hooks.

Tags
author

Michael Slusarz slusarz@horde.org

category

Horde

copyright

2013-2017 Horde LLC

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

since
2.11.0

Table of Contents

Properties

$_apps  : array<string|int, mixed>
Cached hook objects (keys are application names).

Methods

callHook()  : mixed
Call a Horde hook.
hookExists()  : bool
Returns whether a hook exists.

Properties

$_apps

Cached hook objects (keys are application names).

protected array<string|int, mixed> $_apps = array()

Methods

callHook()

Call a Horde hook.

public callHook(string $hook[, string $app = 'horde' ][, array<string|int, mixed> $args = array() ]) : mixed

WARNING: Throwing exceptions is expensive, so use callHook() with care and cache the results if you going to use the results more than once.

Parameters
$hook : string

The hook function to call.

$app : string = 'horde'

The hook application.

$args : array<string|int, mixed> = array()

An array of any arguments to pass to the hook function.

Tags
throws
Horde_Exception

Thrown on error from hook code.

throws
Horde_Exception_HookNotSet

Thrown if hook is not active.

Return values
mixed

The results of the hook.

hookExists()

Returns whether a hook exists.

public hookExists(string $hook[, string $app = 'horde' ]) : bool

Use this if you have to call a hook many times and expect the hook to not exist.

Parameters
$hook : string

The hook function.

$app : string = 'horde'

The hook application.

Return values
bool

True if the hook exists.


        
On this page

Search results