Class FilterIterator

Summary

Fully Qualified Name: Zend\EventManager\Filter\FilterIterator
Extends: FastPriorityQueue

Description

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

Allows removal

Methods

Name Description Defined By
contains() Does the queue contain a given value? FilterIterator
count() Get the total number of elements in the queue FastPriorityQueue
current() Get the current element in the queue FastPriorityQueue
extract() Extract an element in the queue according to the priority and the order of insertion FastPriorityQueue
hasPriority() Does the queue have an item with the given priority? FastPriorityQueue
insert() Insert a value into the queue. FilterIterator
isEmpty() Check if the queue is empty FastPriorityQueue
key() Get the index of the current element in the queue FastPriorityQueue
next() Iterate the next filter in the chain FilterIterator
remove() Remove a value from the queue FilterIterator
rewind() Rewind the current iterator FastPriorityQueue
serialize() Serialize FastPriorityQueue
setExtractFlags() Set the extract flag FastPriorityQueue
toArray() Serialize to an array FastPriorityQueue
unserialize() Deserialize FastPriorityQueue
valid() Check if the current iterator is valid FastPriorityQueue

Method Details

contains()

Does the queue contain a given value?

Parameter Name Type Description
$datum mixed

Returns: bool

count()

Get the total number of elements in the queue

Returns: int

current()

Get the current element in the queue

Returns: mixed

extract()

Extract an element in the queue according to the priority and the order of insertion

Returns: mixed

hasPriority()

Does the queue have an item with the given priority?

Parameter Name Type Description
$priority int

Returns: bool

insert()

Insert a value into the queue.

Requires a callable.

Parameter Name Type Description
$value callable
$priority mixed

Returns: void

isEmpty()

Check if the queue is empty

Returns: bool

key()

Get the index of the current element in the queue

Returns: int

next()

Iterate the next filter in the chain

Iterates and calls the next filter in the chain.

Parameter Name Type Description
$context mixed
$params array
$chain \FilterIterator

Returns: mixed

remove()

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.

Parameter Name Type Description
$datum mixed

Returns: bool

rewind()

Rewind the current iterator

Returns:

serialize()

Serialize

Returns: string

setExtractFlags()

Set the extract flag

Parameter Name Type Description
$flag int

Returns:

toArray()

Serialize to an array

Array will be priority => data pairs

Returns: array

unserialize()

Deserialize

Parameter Name Type Description
$data string

Returns: void

valid()

Check if the current iterator is valid

Returns: bool

Top