Bristol SU Support Package
src
Events
EventManager.php
Go to the documentation of this file.
1
<?php
2
3
namespace
BristolSU\Support\Events
;
4
5
use
BristolSU\Support\Events\Contracts\EventManager
as
EventManagerContract
;
6
10
class
EventManager
implements
EventManagerContract
11
{
12
25
protected
$events
= [];
26
37
public
function
registerEvent
($alias, $name, $class, $description)
38
{
39
if
(!isset($this->events[$alias])) {
40
$this->events[$alias] = [];
41
}
42
$this->events[$alias][] = [
43
'name'
=> $name,
44
'description'
=> $description,
45
'event'
=> $class,
46
];
47
}
48
61
public
function
all
()
62
{
63
return
$this->events
;
64
}
65
79
public
function
allForModule
($alias)
80
{
81
return
(array_key_exists($alias, $this->events) ? $this->events[$alias] : []);
82
}
83
84
}
BristolSU\Support\Events
BristolSU\Support\Events\EventManager\registerEvent
registerEvent($alias, $name, $class, $description)
Definition:
EventManager.php:37
BristolSU\Support\Events\EventManager\$events
$events
Definition:
EventManager.php:25
BristolSU\Support\Events\EventManager\allForModule
allForModule($alias)
Definition:
EventManager.php:79
BristolSU\Support\Events\EventManager\all
all()
Definition:
EventManager.php:61
EventManager
BristolSU\Support\Events\EventManager
Definition:
EventManager.php:10
Generated by
1.8.13