‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\Tree\TreeNodeCollection Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Tree\TreeNodeCollection:
TYPO3\CMS\Backend\Tree\SortedTreeNodeCollection

Public Member Functions

 __construct (array $data=[])
 
 asort (int $flags=SORT_REGULAR)
 
int nodeCompare (TreeNode $node, TreeNode $otherNode)
 
 __serialize ()
 
 __unserialize ($arrayRepresentation)
 
array toArray ()
 
 dataFromArray ($data)
 

Detailed Description

Tree Node Collection

Definition at line 24 of file TreeNodeCollection.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\Tree\TreeNodeCollection::__construct ( array  $data = [])

Constructor

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

Parameters
array$data

Definition at line 34 of file TreeNodeCollection.php.

References TYPO3\CMS\Backend\Tree\TreeNodeCollection\dataFromArray().

Member Function Documentation

◆ __serialize()

TYPO3\CMS\Backend\Tree\TreeNodeCollection::__serialize ( )

Returns class state to be serialized.

Definition at line 71 of file TreeNodeCollection.php.

References TYPO3\CMS\Backend\Tree\TreeNodeCollection\toArray().

◆ __unserialize()

TYPO3\CMS\Backend\Tree\TreeNodeCollection::__unserialize (   $arrayRepresentation)

Fills the current node with the given serialized information

Exceptions
Exception‪if the deserialized object type is not identical to the current one

Definition at line 81 of file TreeNodeCollection.php.

References TYPO3\CMS\Backend\Tree\TreeNodeCollection\dataFromArray().

◆ asort()

TYPO3\CMS\Backend\Tree\TreeNodeCollection::asort ( int  $flags = SORT_REGULAR)

Sorts the internal nodes array

Parameters
int$flags‪Optional parameter, ignored. Added to be compatible with asort method signature in PHP 8.
Todo:
‪Use return type "true" instead of bool if PHP8.3+ is minimum supported and remove #[\ReturnTypeWillChange].

Definition at line 50 of file TreeNodeCollection.php.

References TYPO3\CMS\Backend\Tree\TreeNodeCollection\nodeCompare().

Referenced by TYPO3\CMS\Backend\Tree\SortedTreeNodeCollection\append().

◆ dataFromArray()

TYPO3\CMS\Backend\Tree\TreeNodeCollection::dataFromArray (   $data)

Sets the data of the node collection by a given array

Parameters
array$data

Definition at line 112 of file TreeNodeCollection.php.

Referenced by TYPO3\CMS\Backend\Tree\TreeNodeCollection\__construct(), and TYPO3\CMS\Backend\Tree\TreeNodeCollection\__unserialize().

◆ nodeCompare()

int TYPO3\CMS\Backend\Tree\TreeNodeCollection::nodeCompare ( TreeNode  $node,
TreeNode  $otherNode 
)

Compares a node with another one

See also
‪\TYPO3\CMS\Backend\Tree\TreeNode::compareTo
Returns
‪int

Definition at line 63 of file TreeNodeCollection.php.

References TYPO3\CMS\Backend\Tree\TreeNode\compareTo().

Referenced by TYPO3\CMS\Backend\Tree\TreeNodeCollection\asort().

◆ toArray()

array TYPO3\CMS\Backend\Tree\TreeNodeCollection::toArray ( )

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

Returns
‪array

Definition at line 94 of file TreeNodeCollection.php.

Referenced by TYPO3\CMS\Backend\Tree\TreeNodeCollection\__serialize().