EventManager/Filter/FilterIterator.php

Show: inherited
Table of Contents

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_EventManager  

\Zend_EventManager_Filter_FilterIterator

Package: Zend\EventManager

Specialized priority queue implementation for use with an intercepting filter chain.

Allows removal

Parent(s)
\Zend_Stdlib_SplPriorityQueue < \SplPriorityQueue
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

Constant  EXTR_DATA = 1
Constant  EXTR_PRIORITY = 2
Constant  EXTR_BOTH = 3
inherited

Extract an array of ('data' => $value, 'priority' => $priority)

Inherited from: \SplPriorityQueue::EXTR_BOTH\Zend_Stdlib_SplPriorityQueue::EXTR_BOTH

Properties

Propertyprotectedint $count = 0
inherited

Count of items in the queue

Inherited from: \SplPriorityQueue::$$count\Zend_Stdlib_SplPriorityQueue::$$count
Default value0Details
Type
int
Inherited_from
\SplPriorityQueue::$$count  
Inherited_from
\Zend_Stdlib_SplPriorityQueue::$$count  
Propertyprotectedint $extractFlags = self::EXTR_DATA
inherited

Flag indicating what should be returned when iterating or extracting

Inherited from: \SplPriorityQueue::$$extractFlags\Zend_Stdlib_SplPriorityQueue::$$extractFlags
Default valueself::EXTR_DATADetails
Type
int
Inherited_from
\SplPriorityQueue::$$extractFlags  
Inherited_from
\Zend_Stdlib_SplPriorityQueue::$$extractFlags  
Propertyprotectedbool $isPhp53 =
inherited

Inherited from: \Zend_Stdlib_SplPriorityQueue::$$isPhp53
Details
Type
bool
Inherited_from
\Zend_Stdlib_SplPriorityQueue::$$isPhp53  
Propertyprotectedbool|array $preparedQueue = false
Default valuefalseDetails
Type
bool | array
Inherited_from
\SplPriorityQueue::$$preparedQueue  
Inherited_from
\Zend_Stdlib_SplPriorityQueue::$$preparedQueue  
Propertyprotectedarray $queue = array()
inherited

All items in the queue

Inherited from: \SplPriorityQueue::$$queue\Zend_Stdlib_SplPriorityQueue::$$queue
Default valuearray()Details
Type
array
Inherited_from
\SplPriorityQueue::$$queue  
Inherited_from
\Zend_Stdlib_SplPriorityQueue::$$queue  
Propertyprotectedint $serial = PHP_INT_MAX
inherited

<p>Seed used to ensure queue order for items of the same priority</p>Inherited from: \Zend_Stdlib_SplPriorityQueue::$$serial
Default valuePHP_INT_MAXDetails
Type
int
Inherited_from
\Zend_Stdlib_SplPriorityQueue::$$serial  

Methods

methodpublic__construct() : void
inherited

Constructor

Inherited from: \Zend_Stdlib_SplPriorityQueue::__construct()

Creates a new, empty queue

methodpubliccompare(mixed $priority1, mixed $priority2) : int
inherited

Compare two priorities

Inherited from: \SplPriorityQueue::compare()\Zend_Stdlib_SplPriorityQueue::compare()

Returns positive integer if $priority1 is greater than $priority2, 0 if equal, negative otherwise.

Unused internally, and only included in order to retain the same interface as PHP's SplPriorityQueue.

Parameters
Name Type Description
$priority1 mixed
$priority2 mixed
Returns
Type Description
int
methodpubliccontains(mixed $datum) : bool

Does the queue contain a given value?

Parameters
Name Type Description
$datum mixed
Returns
Type Description
bool
methodpubliccount() : int
inherited

Countable: return number of items composed in the queue

Inherited from: \SplPriorityQueue::count()\Zend_Stdlib_SplPriorityQueue::count()
Returns
Type Description
int
methodpubliccurrent() : mixed
inherited

Iterator: return current item

Inherited from: \SplPriorityQueue::current()\Zend_Stdlib_SplPriorityQueue::current()
Returns
Type Description
mixed
methodpublicextract() : \mixed;
inherited

Extract a node from top of the heap and sift up

Inherited from: \SplPriorityQueue::extract()\Zend_Stdlib_SplPriorityQueue::extract()

Returns either the value, the priority, or both, depending on the extract flag.

Returns
Type Description
\mixed;
methodpublicinsert(mixed $datum, mixed $priority) : void
inherited

Insert a value with a given priority

Inherited from: \Zend_Stdlib_SplPriorityQueue::insert()

Utilizes {@var $serial} to ensure that values of equal priority are emitted in the same order in which they are inserted.

Parameters
Name Type Description
$datum mixed
$priority mixed
methodpublicisEmpty() : bool
inherited

Is the queue currently empty?

Inherited from: \SplPriorityQueue::isEmpty()\Zend_Stdlib_SplPriorityQueue::isEmpty()
Returns
Type Description
bool
methodpublickey() : mixed
inherited

Iterator: return current key

Inherited from: \SplPriorityQueue::key()\Zend_Stdlib_SplPriorityQueue::key()
Returns
Type Description
mixed Usually an int or string
methodpublicnext(mixed $context = null, array $params = array(), \Zend_EventManager_Filter_FilterIterator $chain = null) : void

Iterate the next filter in the chain

Iterates and calls the next filter in the chain.

Parameters
Name Type Description
$context mixed
$params array
$chain \Zend_EventManager_Filter_FilterIterator
methodprotectedprepareQueue() : void
inherited

Prepare the queue for iteration and/or extraction

Inherited from: \SplPriorityQueue::prepareQueue()\Zend_Stdlib_SplPriorityQueue::prepareQueue()
methodpublicrecoverFromCorruption() : void
inherited

Recover from corrupted state and allow further actions on the queue

Inherited from: \SplPriorityQueue::recoverFromCorruption()\Zend_Stdlib_SplPriorityQueue::recoverFromCorruption()

Unimplemented, and only included in order to retain the same interface as PHP's SplPriorityQueue.

methodpublicremove(mixed $datum) : bool

Remove a value from the queue

This is an expensive operation. It must first iterate through all values, and then re-populate itself. Use only if absolutely necessary.

Parameters
Name Type Description
$datum mixed
Returns
Type Description
bool
methodpublicrewind() : void
inherited

Iterator: Move pointer to first item

Inherited from: \SplPriorityQueue::rewind()\Zend_Stdlib_SplPriorityQueue::rewind()
methodpublicserialize() : string
inherited

Serialize

Inherited from: \Zend_Stdlib_SplPriorityQueue::serialize()
Returns
Type Description
string
methodpublicsetExtractFlags(int $flags) : void

Defines what is extracted by SplPriorityQueue::current(), SplPriorityQueue::top() and SplPriorityQueue::extract().

  • SplPriorityQueue::EXTR_DATA (0x00000001): Extract the data
  • SplPriorityQueue::EXTR_PRIORITY (0x00000002): Extract the priority
  • SplPriorityQueue::EXTR_BOTH (0x00000003): Extract an array containing both

The default mode is SplPriorityQueue::EXTR_DATA.

Parameters
Name Type Description
$flags int
methodprotectedsort() : void
inherited

Sort the queue

Inherited from: \SplPriorityQueue::sort()\Zend_Stdlib_SplPriorityQueue::sort()
methodpublictoArray() : array
inherited

Serialize to an array

Inherited from: \Zend_Stdlib_SplPriorityQueue::toArray()

Array will be priority => data pairs

Returns
Type Description
array
methodpublictop() : mixed
inherited

Return the value or priority (or both) of the top node, depending on the extract flag

Inherited from: \SplPriorityQueue::top()\Zend_Stdlib_SplPriorityQueue::top()
Returns
Type Description
mixed
methodpublicunserialize(string $data) : void
inherited

Deserialize

Inherited from: \Zend_Stdlib_SplPriorityQueue::unserialize()
Parameters
Name Type Description
$data string
methodpublicvalid() : bool
inherited

Iterator: is the current position valid for the queue

Inherited from: \SplPriorityQueue::valid()\Zend_Stdlib_SplPriorityQueue::valid()
Returns
Type Description
bool
Documentation was generated by phpDocumentor 2.0.0a8.