eZ Publish Community Project (Legacy Stack) 2013.4
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 on an event

mixed filter(string $name, array|string|numeric $value)

Notify all listeners on an event but stop if any of them return something else then null

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 on 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 150
public mixed filter(string $name, array|string|numeric $value)

Notify all listeners on an event but stop if any of them return something else then null

Parameters

string $name In the form "content/delete/1", "content/delete", "content/read"
array|string|numeric $value The value you want to let listeners filter

Return Value

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

at line 174
static public ezpEvent getInstance()

Gets instance

Return Value

ezpEvent

at line 186
static public resetInstance()

Resets instance