Class ListenersPriorityQueue
A class containing an inner listeners priority queue that can be iterated
multiple times. One instance of ListenersPriorityQueue is used per Event in the
Dispatcher.
-
Joomla\Event\ListenersPriorityQueue
implements
IteratorAggregate,
Countable
Methods summary
public
|
|
public
Joomla\Event\ListenersPriorityQueue
|
#
add( Closure |object $listener, integer $priority )
Add a listener with the given priority only if not already present.
Add a listener with the given priority only if not already present.
Parameters
- $listener
Closure |object - $listener The listener.
- $priority
integer - $priority The listener priority.
Returns
Since
1.0
|
public
Joomla\Event\ListenersPriorityQueue
|
#
remove( Closure |object $listener )
Remove a listener from the queue.
Remove a listener from the queue.
Parameters
- $listener
Closure |object - $listener The listener.
Returns
Since
1.0
|
public
boolean
|
#
has( Closure |object $listener )
Tell if the listener exists in the queue.
Tell if the listener exists in the queue.
Parameters
- $listener
Closure |object - $listener The listener.
Returns
boolean - True if it exists, false otherwise.
Since
1.0
|
public
mixed
|
#
getPriority( Closure |object $listener, mixed $default = null )
Get the priority of the given listener.
Get the priority of the given listener.
Parameters
- $listener
Closure |object - $listener The listener.
- $default
mixed - $default The default value to return if the listener doesn't exist.
Returns
mixed - The listener priority if it exists, null otherwise.
Since
1.0
|
public
object[]
|
#
getAll( )
Get all listeners contained in this queue, sorted according to their
priority.
Get all listeners contained in this queue, sorted according to their
priority.
Returns
object[] - An array of listeners.
Since
1.0
|
public
SplPriorityQueue
|
#
getIterator( )
Get the inner queue with its cursor on top of the heap.
Get the inner queue with its cursor on top of the heap.
Returns
Since
1.0
Implementation of
|
public
integer
|
#
count( )
Count the number of listeners in the queue.
Count the number of listeners in the queue.
Returns
integer - The number of listeners in the queue.
Since
1.0
Implementation of
|
Magic methods summary
Properties summary
protected
SplPriorityQueue
|
$queue
|
#
The inner priority queue.
The inner priority queue.
Since
1.0
|
protected
SplObjectStorage
|
$storage
|
#
A copy of the listeners contained in the queue that is used when detaching
them to recreate the queue or to see if the queue contains a given listener.
A copy of the listeners contained in the queue that is used when detaching
them to recreate the queue or to see if the queue contains a given listener.
Since
1.0
|