Class

ezpEvent

class ezpEvent

This class handles internal kernel events in eZ Publish, aka hooks.

Methods

__construct(bool $loadGlobalEvents = true)

Constructer In most cases you would want to use {see getInstance()} instead

registerEventListeners()

Registers the event listeners defined the site.ini files.

int attach(string $name, array|string $listener)

Attach an event listener at run time on demand.

bool detach(string $name, int $id)

Detach an event listener by id given when it was added.

bool notify(string $name, array $params = array())

Notify all listeners of an event

mixed filter($name, $value)

Call all listeners of an event and allow them to filter (change) first value

static ezpEvent getInstance()

Gets instance

static  resetInstance()

Resets instance

Details

at line 56
public __construct(bool $loadGlobalEvents = true)

Constructer In most cases you would want to use {see getInstance()} instead

Parameters

bool $loadGlobalEvents Load global events from ini settings

at line 64
public registerEventListeners()

Registers the event listeners defined the site.ini files.

at line 91
public int attach(string $name, array|string $listener)

Attach an event listener at run time on demand.

Parameters

string $name In the form "content/delete/1" or "content/delete"
array|string $listener A valid PHP callback {see http://php.net/manual/en/language.pseudo-types.php#language.types.callback}

Return Value

int Listener id, can be used to detach a listener later {see detach()}

at line 111
public bool detach(string $name, int $id)

Detach an event listener by id given when it was added.

Parameters

string $name
int $id The unique id given by {see attach()}

Return Value

bool True if the listener has been correctly detached

at line 129
public bool notify(string $name, array $params = array())

Notify all listeners of an event

Parameters

string $name In the form "content/delete/1", "content/delete", "content/read"
array $params The arguments for the specific event as simple array structure (not hash)

Return Value

bool True if some listener where called

at line 151
public mixed filter($name, $value)

Call all listeners of an event and allow them to filter (change) first value

Parameters

$name
$value

Return Value

mixed First $value param after being filtered by filters, or unmodified if no filters

at line 175
static public ezpEvent getInstance()

Gets instance

Return Value

ezpEvent

at line 187
static public resetInstance()

Resets instance