TreeNodeCollection

class \TYPO3\CMS\Backend\Tree\TreeNodeCollection

Extends
ArrayObject

Tree Node Collection

Table of Contents

Methods

__construct()  : mixed
Constructor
__serialize()  : array
Returns class state to be serialized.
__unserialize()  : void
Fills the current node with the given serialized information
asort()  : bool
Sorts the internal nodes array
dataFromArray()  : mixed
Sets the data of the node collection by a given array
nodeCompare()  : int
Compares a node with another one
toArray()  : array
Returns the collection in an array representation for e.g. serialization

Methods

__construct()

Constructor

public __construct([array $data = [] ]) : mixed

You can move an initial data array to initialize the instance and further objects. This is useful for the deserialization.

Parameters

$data : array = []

__serialize()

Returns class state to be serialized.

public __serialize() : array

Return values

array

__unserialize()

Fills the current node with the given serialized information

public __unserialize(mixed $arrayRepresentation) : void

Parameters

$arrayRepresentation : mixed

Tags

throws
Exception

if the deserialized object type is not identical to the current one

asort()

Sorts the internal nodes array

public asort([int $flags = SORT_REGULAR ]) : bool

Parameters

$flags : int = SORT_REGULAR

Optional parameter, ignored. Added to be compatible with asort method signature in PHP 8.

Tags

todo

Use return type "true" instead of bool if PHP8.3+ is minimum supported and remove #[\ReturnTypeWillChange].

Attributes

#[ReturnTypeWillChange]

Return values

bool

dataFromArray()

Sets the data of the node collection by a given array

public dataFromArray(array $data) : mixed

Parameters

$data : array

nodeCompare()

Compares a node with another one

public nodeCompare(TreeNode $node, TreeNode $otherNode) : int

Parameters

$node : TreeNode
$otherNode : TreeNode

Tags

see
TreeNode::compareTo

Return values

int

toArray()

Returns the collection in an array representation for e.g. serialization

public toArray() : array

Return values

array
On this page