JOOMLA中国
  • Joomla中国首页
  • 社区
  • 教程
  • 应用市场
  • B计划
Joomla! Framework TM
  • Namespace
  • Class
  • Tree
  • Deprecated

Namespaces

  • Composer
    • Autoload
  • Joomla
    • Application
      • Cli
        • Output
          • Processor
      • Web
    • Data
    • DI
      • Exception
    • Event
    • Filter
    • Input
    • Ldap
    • Registry
      • Format
    • Session
      • Storage
    • String
    • Uri
    • Utilities
  • None
  • PasswordCompat
    • binary
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Yaml
        • Exception
    • Polyfill
      • Util

Classes

  • AbstractEvent
  • DelegatingDispatcher
  • Dispatcher
  • Event
  • EventImmutable
  • ListenersPriorityQueue
  • Priority

Interfaces

  • DispatcherAwareInterface
  • DispatcherInterface
  • EventInterface

Traits

  • DispatcherAwareTrait

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
Namespace: Joomla\Event
Since: 1.0
Located at vendor/joomla/event/src/ListenersPriorityQueue.php

Methods summary

public
# __construct( )

Constructor.

Constructor.

Since

1.0
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

Joomla\Event\ListenersPriorityQueue - This method is chainable.

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

Joomla\Event\ListenersPriorityQueue - This method is chainable.

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

SplPriorityQueue - The inner queue.

Since

1.0

Implementation of

IteratorAggregate::getIterator()
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

Countable::count()

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
Joomla! Framework TM API documentation generated by ApiGen 2.8.0
Joomla!® and Joomla! Framework™ are trademarks of Open Source Matters, Inc. in the United States and other countries.