Avolutions\Event\ListenerCollection
implements CollectionInterface Uses CollectionTraitThe ListenerCollection contains all registered event listener.
Properties
Property | Visibility | Type | Description |
---|---|---|---|
$items | public | array | The items of the Collection. |
Methods
Method | Visibility | Description |
---|---|---|
addListener() | public | Adds a listener for an event the ListenerCollection. |
count() | public | Returns the number of items in the Collection. |
getAll() | public | Returns all items of the Collection. |
getListener() | public | Returns a callable listener for the given event from the ListenerCollection. |
Property Details
Method Details
addListener()
Adds a listener for an event the ListenerCollection.
public
addListener(string $eventName, array<string|int, mixed> $listener) : mixed
Parameters
string
$eventName
The name of the event.
array<string|int, mixed>
$listener
An array containing the Listener class and method.
Return values
mixed Adds a listener for an event the ListenerCollection.count()
Returns the number of items in the Collection.
public
count() : int
Return values
int Returns the number of items in the Collection.getAll()
Returns all items of the Collection.
public
getAll() : array<string|int, mixed>
Return values
array<string|int, mixed> Returns all items of the Collection.getListener()
Returns a callable listener for the given event from the ListenerCollection.
public
getListener(string $eventName) : callable|array<string|int, mixed>
Parameters
string
$eventName
The name of the event.