TreeCollection

Implements \IteratorAggregate, \Countable, \JsonSerializable

TreeCollection

package

TreeHelper

subpackage

Tree

Methods

Constructor

__construct(array|\Iterator $Elements = array()) 

Arguments

$Elements

array|\Iterator

Add node

add(\TreeCollectionNode $Node) : \TreeCollection

Arguments

Response

\TreeCollection

Count

count() : integer

Response

integer

Apply filter to current nodes

filter(callable $callback) : \TreeCollection

Arguments

$callback

callable

Response

\TreeCollection

Apply filter to current nodes and all children nodes

filterRecursive(callable $callback) : \TreeCollection

Arguments

$callback

callable

Response

\TreeCollection

Apply filter to all children nodes and then to current nodes

filterRecursiveReverse(callable $callback) : \TreeCollection

Arguments

$callback

callable

Response

\TreeCollection

Removes all nodes

flushNodes() : \TreeCollection

Response

\TreeCollection

Iterator

getIterator() : \ArrayIterator

Response

\ArrayIterator

Returns tree nodes

getNodes() : \ArrayObjectA

Response

\ArrayObjectA

Returns true if current tree is equals to $Tree

isEquals(\TreeCollection $Tree) : boolean

Arguments

Response

boolean

Json serialization

jsonSerialize() : \ArrayObjectA

Response

\ArrayObjectA

Apply multisort to current nodes

multisort(array|string $params) : \TreeCollection

Arguments

$params

array|string

Response

\TreeCollection

Apply multisort to current nodes and all children nodes

multisortRecursive(array|string $params) : \TreeCollection

Arguments

$params

array|string

Response

\TreeCollection

Remove node

remove(\TreeCollectionNode $Node) : \TreeCollection

Arguments

Response

\TreeCollection

Set nodes

setNodes(array|\iterator $Nodes) : \TreeCollection

Arguments

$Nodes

array|\iterator

Response

\TreeCollection

Constants

Node class name

NODE_CLASS

Properties

TreeCollection nodes

_Nodes : \ArrayObjectA
var

Type(s)

\ArrayObjectA