EventManager/Filter/FilterIterator.php
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
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

EXTR_DATA
= 1
Extract data only
Inherited from: \SplPriorityQueue::EXTR_DATA\Zend_Stdlib_SplPriorityQueue::EXTR_DATA- Inherited_from
- \SplPriorityQueue::EXTR_DATA
- Inherited_from
- \Zend_Stdlib_SplPriorityQueue::EXTR_DATA

EXTR_PRIORITY
= 2
Extract priority only
Inherited from: \SplPriorityQueue::EXTR_PRIORITY\Zend_Stdlib_SplPriorityQueue::EXTR_PRIORITY- Inherited_from
- \SplPriorityQueue::EXTR_PRIORITY
- Inherited_from
- \Zend_Stdlib_SplPriorityQueue::EXTR_PRIORITY

EXTR_BOTH
= 3
Extract an array of ('data' => $value, 'priority' => $priority)
Inherited from: \SplPriorityQueue::EXTR_BOTH\Zend_Stdlib_SplPriorityQueue::EXTR_BOTH- Inherited_from
- \SplPriorityQueue::EXTR_BOTH
- Inherited_from
- \Zend_Stdlib_SplPriorityQueue::EXTR_BOTH
Properties


int $count = 0
Count of items in the queue
Inherited from: \SplPriorityQueue::$$count\Zend_Stdlib_SplPriorityQueue::$$count0
Details- Type
- int
- Inherited_from
- \SplPriorityQueue::$$count
- Inherited_from
- \Zend_Stdlib_SplPriorityQueue::$$count


int $extractFlags = self::EXTR_DATA
Flag indicating what should be returned when iterating or extracting
Inherited from: \SplPriorityQueue::$$extractFlags\Zend_Stdlib_SplPriorityQueue::$$extractFlagsself::EXTR_DATA
Details- Type
- int
- Inherited_from
- \SplPriorityQueue::$$extractFlags
- Inherited_from
- \Zend_Stdlib_SplPriorityQueue::$$extractFlags


bool $isPhp53 =
- Type
- bool
- Inherited_from
- \Zend_Stdlib_SplPriorityQueue::$$isPhp53


bool|array $preparedQueue = false
false
Details- Type
- bool | array
- Inherited_from
- \SplPriorityQueue::$$preparedQueue
- Inherited_from
- \Zend_Stdlib_SplPriorityQueue::$$preparedQueue


array $queue = array()
All items in the queue
Inherited from: \SplPriorityQueue::$$queue\Zend_Stdlib_SplPriorityQueue::$$queuearray()
Details- Type
- array
- Inherited_from
- \SplPriorityQueue::$$queue
- Inherited_from
- \Zend_Stdlib_SplPriorityQueue::$$queue


int $serial = PHP_INT_MAX
PHP_INT_MAX
Details- Type
- int
- Inherited_from
- \Zend_Stdlib_SplPriorityQueue::$$serial
Methods


compare(mixed $priority1, mixed $priority2) : int
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.
Name | Type | Description |
---|---|---|
$priority1 | mixed | |
$priority2 | mixed |
Type | Description |
---|---|
int |


contains(mixed $datum) : bool
Does the queue contain a given value?
Name | Type | Description |
---|---|---|
$datum | mixed |
Type | Description |
---|---|
bool |


count() : int
Countable: return number of items composed in the queue
Inherited from: \SplPriorityQueue::count()\Zend_Stdlib_SplPriorityQueue::count()Type | Description |
---|---|
int |


current() : mixed
Iterator: return current item
Inherited from: \SplPriorityQueue::current()\Zend_Stdlib_SplPriorityQueue::current()Type | Description |
---|---|
mixed |


extract() : \mixed;
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.
Type | Description |
---|---|
\mixed; |


insert(mixed $datum, mixed $priority) : void
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.
Name | Type | Description |
---|---|---|
$datum | mixed | |
$priority | mixed |


isEmpty() : bool
Is the queue currently empty?
Inherited from: \SplPriorityQueue::isEmpty()\Zend_Stdlib_SplPriorityQueue::isEmpty()Type | Description |
---|---|
bool |


key() : mixed
Iterator: return current key
Inherited from: \SplPriorityQueue::key()\Zend_Stdlib_SplPriorityQueue::key()Type | Description |
---|---|
mixed | Usually an int or string |


next(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.
Name | Type | Description |
---|---|---|
$context | mixed | |
$params | array | |
$chain | \Zend_EventManager_Filter_FilterIterator |


prepareQueue() : void
Prepare the queue for iteration and/or extraction
Inherited from: \SplPriorityQueue::prepareQueue()\Zend_Stdlib_SplPriorityQueue::prepareQueue()

recoverFromCorruption() : void
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.


remove(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.
Name | Type | Description |
---|---|---|
$datum | mixed |
Type | Description |
---|---|
bool |


rewind() : void
Iterator: Move pointer to first item
Inherited from: \SplPriorityQueue::rewind()\Zend_Stdlib_SplPriorityQueue::rewind()

setExtractFlags(int $flags) : void
Set the extract flags
Inherited from: \SplPriorityQueue::setExtractFlags()\Zend_Stdlib_SplPriorityQueue::setExtractFlags()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.
Name | Type | Description |
---|---|---|
$flags | int |


sort() : void
Sort the queue
Inherited from: \SplPriorityQueue::sort()\Zend_Stdlib_SplPriorityQueue::sort()

top() : mixed
Return the value or priority (or both) of the top node, depending on the extract flag
Inherited from: \SplPriorityQueue::top()\Zend_Stdlib_SplPriorityQueue::top()Type | Description |
---|---|
mixed |


valid() : bool
Iterator: is the current position valid for the queue
Inherited from: \SplPriorityQueue::valid()\Zend_Stdlib_SplPriorityQueue::valid()Type | Description |
---|---|
bool |