Bristol SU Support Package
Public Member Functions | Protected Attributes | List of all members
BristolSU\Support\Events\EventManager Class Reference
Inheritance diagram for BristolSU\Support\Events\EventManager:
Inheritance graph
[legend]
Collaboration diagram for BristolSU\Support\Events\EventManager:
Collaboration graph
[legend]

Public Member Functions

 registerEvent ($alias, $name, $class, $description)
 
 all ()
 
 allForModule ($alias)
 

Protected Attributes

 $events = []
 

Detailed Description

Class EventManager

Definition at line 10 of file EventManager.php.

Member Function Documentation

◆ all()

BristolSU\Support\Events\EventManager::all ( )

Get all events

Returns all events, each one in the form [ 'name' => 'Event Name', 'description' => 'Event Description', 'event' => 'Event Class Name' ]

Returns
array All events

Implements BristolSU\Support\Events\Contracts\EventManager.

Definition at line 61 of file EventManager.php.

References BristolSU\Support\Events\EventManager\$events.

◆ allForModule()

BristolSU\Support\Events\EventManager::allForModule (   $alias)

Get all events for a given module

Returns all events, each one in the form [ 'name' => 'Event Name', 'description' => 'Event Description', 'event' => 'Event Class Name' ]

Parameters
string$aliasModule alias
Returns
array All events fired by the module

Implements BristolSU\Support\Events\Contracts\EventManager.

Definition at line 79 of file EventManager.php.

◆ registerEvent()

BristolSU\Support\Events\EventManager::registerEvent (   $alias,
  $name,
  $class,
  $description 
)

Register an event

Parameters
string$aliasModule alias registering the event
string$nameEvent Name
string$classEvent Class
string$descriptionEvent Description
Returns
void

Implements BristolSU\Support\Events\Contracts\EventManager.

Definition at line 37 of file EventManager.php.

Member Data Documentation

◆ $events

BristolSU\Support\Events\EventManager::$events = []
protected

Definition at line 25 of file EventManager.php.

Referenced by BristolSU\Support\Events\EventManager\all().


The documentation for this class was generated from the following file: