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
= 1Extract 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
= 2Extract 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
= 3Extract 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 = 0Count of items in the queue
Inherited from: \SplPriorityQueue::$$count\Zend_Stdlib_SplPriorityQueue::$$count0Details- Type
- int
- Inherited_from
- \SplPriorityQueue::$$count
- Inherited_from
- \Zend_Stdlib_SplPriorityQueue::$$count

int $extractFlags = self::EXTR_DATAFlag indicating what should be returned when iterating or extracting
Inherited from: \SplPriorityQueue::$$extractFlags\Zend_Stdlib_SplPriorityQueue::$$extractFlagsself::EXTR_DATADetails- 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 = falsefalseDetails- 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_MAXPHP_INT_MAXDetails- Type
- int
- Inherited_from
- \Zend_Stdlib_SplPriorityQueue::$$serial
Methods

compare(mixed $priority1, mixed $priority2) : intCompare 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) : boolDoes the queue contain a given value?
| Name | Type | Description |
|---|---|---|
| $datum | mixed |
| Type | Description |
|---|---|
| bool |

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

current() : mixedIterator: 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) : voidInsert 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() : boolIs the queue currently empty?
Inherited from: \SplPriorityQueue::isEmpty()\Zend_Stdlib_SplPriorityQueue::isEmpty()| Type | Description |
|---|---|
| bool |

key() : mixedIterator: 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) : voidIterate 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() : voidPrepare the queue for iteration and/or extraction
Inherited from: \SplPriorityQueue::prepareQueue()\Zend_Stdlib_SplPriorityQueue::prepareQueue()
recoverFromCorruption() : voidRecover 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) : boolRemove 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() : voidIterator: Move pointer to first item
Inherited from: \SplPriorityQueue::rewind()\Zend_Stdlib_SplPriorityQueue::rewind()
setExtractFlags(int $flags) : voidSet 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() : voidSort the queue
Inherited from: \SplPriorityQueue::sort()\Zend_Stdlib_SplPriorityQueue::sort()
top() : mixedReturn 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() : boolIterator: is the current position valid for the queue
Inherited from: \SplPriorityQueue::valid()\Zend_Stdlib_SplPriorityQueue::valid()| Type | Description |
|---|---|
| bool |