Interface: IEventManager

Interface for event management.

Known implementations

Authors

Oleg Schildt

Package

Source code

 

Methods
public

Adds the handler of an event.

public

Deletes all handlers of all events.

public

Deletes the handler of an event.

public

Deletes all handlers of an event.

public

Fires and event.

public

Resumes all previously suspended events.

public

Resumes a previously suspended event.

public

Suspends an event.


Method: IEventManager::addHandler()

public function addHandler(string $event, callable $handler): void;

Adds the handler of an event.

Parameters

Name Pass type Value type Default value Description
$event by value string

Event code.

$handler by value callable

The name or definition of the handler function. The signature of this function is:

function (string $event, array $parameters) : void;
  • $event - the event code.
  • $parameters - parameters passed by the firing of the event.

Returns

void

Throws

\Exception

It might throw an exception in the case of any errors.

Authors

Oleg Schildt

Source code

See also


Method: IEventManager::deleteAllHandlers()

public function deleteAllHandlers(): void;

Deletes all handlers of all events.

Returns

void

Authors

Oleg Schildt

Source code

See also


Method: IEventManager::deleteHandler()

public function deleteHandler(string $event, callable $handler): void;

Deletes the handler of an event.

Parameters

Name Pass type Value type Default value Description
$event by value string

Event code.

$handler by value callable

The name or definition of the handler function. otherwise false.

Returns

void

Throws

\Exception

It might throw an exception in the case of any errors.

Authors

Oleg Schildt

Source code

See also


Method: IEventManager::deleteHandlers()

public function deleteHandlers(string $event): void;

Deletes all handlers of an event.

Parameters

Name Pass type Value type Default value Description
$event by value string

Event code.

Returns

void

Throws

\Exception

It might throw an exception in the case of any errors.

Authors

Oleg Schildt

Source code

See also


Method: IEventManager::fireEvent()

public function fireEvent(string $event, array $parameters): int;

Fires and event.

Parameters

Name Pass type Value type Default value Description
$event by value string

Event code.

$parameters by value array

Event code.

Returns

int

Should return number of the handlers called for this event.

Throws

\Exception

It might throw an exception in the case of any errors.

Authors

Oleg Schildt

Source code


Method: IEventManager::resumeAllEvents()

public function resumeAllEvents(): void;

Resumes all previously suspended events.

Returns

void

Authors

Oleg Schildt

Source code

See also


Method: IEventManager::resumeEvent()

public function resumeEvent(string $event): void;

Resumes a previously suspended event.

Parameters

Name Pass type Value type Default value Description
$event by value string

Event code.

Returns

void

Throws

\Exception

It might throw an exception in the case of any errors.

Authors

Oleg Schildt

Source code

See also


Method: IEventManager::suspendEvent()

public function suspendEvent(string $event): void;

Suspends an event.

Details

If an event is suspended, its handlers are not called when the event is fired.

Parameters

Name Pass type Value type Default value Description
$event by value string

Event code.

Returns

void

Throws

\Exception

It might throw an exception in the case of any errors.

Authors

Oleg Schildt

Source code

See also