‪TYPO3CMS  11.5
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 ($flags=SORT_REGULAR)
 
int nodeCompare (TreeNode $node, TreeNode $otherNode)
 
string serialize ()
 
 __serialize ()
 
 unserialize ($serializedString)
 
 __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.

Todo:
‪: Change signature to __serialize(): array in v12

Definition at line 86 of file TreeNodeCollection.php.

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

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

◆ __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
Todo:
‪: Change signature to __unserialize(array $arrayRepresentation): void in v12

Definition at line 111 of file TreeNodeCollection.php.

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

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

◆ asort()

TYPO3\CMS\Backend\Tree\TreeNodeCollection::asort (   $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:
‪: Set return type to void in v12 as breaking patch and drop #[\ReturnTypeWillChange]

Definition at line 49 of file TreeNodeCollection.php.

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 142 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
Parameters
TreeNode$node
TreeNode$otherNode
Returns
‪int

Definition at line 63 of file TreeNodeCollection.php.

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

◆ serialize()

string TYPO3\CMS\Backend\Tree\TreeNodeCollection::serialize ( )

Returns the serialized instance

Returns
‪string
Todo:
‪: Drop method and \Serializable class interface in v12.

Definition at line 75 of file TreeNodeCollection.php.

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

◆ toArray()

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

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

Returns
‪array

Definition at line 124 of file TreeNodeCollection.php.

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

◆ unserialize()

TYPO3\CMS\Backend\Tree\TreeNodeCollection::unserialize (   $serializedString)

Create class state from serialized array.

Parameters
string$serializedString
Exceptions
Exception‪if the deserialized object type is not identical to the current one
Todo:
‪: Drop method and \Serializable class interface in v12.

Definition at line 99 of file TreeNodeCollection.php.

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