EventManager/Filter/FilterIterator.php

Show: PublicProtectedPrivateinherited
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 license@zend.com 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

>VConstant  EXTR_DATA = 1
>VConstant  EXTR_PRIORITY = 2
>VConstant  EXTR_BOTH = 3
inherited
Extract an array of ('data' => $value, 'priority' => $priority)
Inherited from: \SplPriorityQueue::EXTR_BOTH\Zend_Stdlib_SplPriorityQueue::EXTR_BOTH

Properties

>VPropertyprotectedint $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  
>VPropertyprotectedint $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  
>VPropertyprotectedbool $isPhp53
Details
Type
bool
Inherited_from
\Zend_Stdlib_SplPriorityQueue::$$isPhp53  
>VPropertyprotectedbool|array $preparedQueue = false
Default valuefalseDetails
Type
bool | array
Inherited_from
\SplPriorityQueue::$$preparedQueue  
Inherited_from
\Zend_Stdlib_SplPriorityQueue::$$preparedQueue  
>VPropertyprotectedarray $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  
>VPropertyprotectedint $serial = PHP_INT_MAX
inherited

Seed used to ensure queue order for items of the same priority

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
NameTypeDescription
$priority1mixed
$priority2mixed
Returns
TypeDescription
int
methodpubliccontains(mixed $datum) : bool

Does the queue contain a given value?

Parameters
NameTypeDescription
$datummixed
Returns
TypeDescription
bool
methodpubliccount() : int
inherited

Countable: return number of items composed in the queue

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

Iterator: return current item

Inherited from: \SplPriorityQueue::current()\Zend_Stdlib_SplPriorityQueue::current()
Returns
TypeDescription
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
TypeDescription
\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
NameTypeDescription
$datummixed
$prioritymixed
methodpublicisEmpty() : bool
inherited

Is the queue currently empty?

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

Iterator: return current key

Inherited from: \SplPriorityQueue::key()\Zend_Stdlib_SplPriorityQueue::key()
Returns
TypeDescription
mixedUsually 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
NameTypeDescription
$contextmixed
$paramsarray
$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
NameTypeDescription
$datummixed
Returns
TypeDescription
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
TypeDescription
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
NameTypeDescription
$flagsint
methodprotectedsort() : void
methodpublictoArray() : array
inherited

Serialize to an array

Inherited from: \Zend_Stdlib_SplPriorityQueue::toArray()

Array will be priority => data pairs

Returns
TypeDescription
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
TypeDescription
mixed
methodpublicunserialize(string $data) : void
inherited

Deserialize

Inherited from: \Zend_Stdlib_SplPriorityQueue::unserialize()
Parameters
NameTypeDescription
$datastring
methodpublicvalid() : bool
inherited

Iterator: is the current position valid for the queue

Inherited from: \SplPriorityQueue::valid()\Zend_Stdlib_SplPriorityQueue::valid()
Returns
TypeDescription
bool
Documentation was generated by phpDocumentor 2.0.0a12.