TreeRepresentationNode

class \TYPO3\CMS\Backend\Tree\TreeRepresentationNode

Extends
TreeNode

Representation Tree Node

Table of Contents

Properties

$additionalData  : array
$callbackAction  : string
Callback function that is called e.g after a click on the label
$childNodes  : TreeNodeCollection|null
Child Nodes
$class  : string
Node CSS Class
$icon  : string|Icon
Node Icon
$id  : string|int
Node Identifier
$label  : string
Node Label
$parentNode  : TreeNode|null
Parent Node
$type  : string
Node Type

Methods

__construct()  : mixed
Constructor
__serialize()  : array
Returns class state to be serialized.
__unserialize()  : void
Fills the current node with the given serialized information
compareTo()  : int
Compares a node to another one.
dataFromArray()  : mixed
Sets data of the node by a given data array
equals()  : bool
Compares a node if it's identical to another node by the id property.
getAdditionalData()  : array
getCallbackAction()  : string
Returns the callback action
getChildNodes()  : TreeNodeCollection
Returns child nodes collection
getClass()  : string
getIcon()  : string|Icon
getId()  : string|int
Returns the identifier
getLabel()  : string
getParentNode()  : TreeNode
Returns the parent node
getType()  : string
hasChildNodes()  : bool
Returns TRUE if the node has child nodes attached
removeChildNodes()  : mixed
Removes child nodes collection
serialize()  : string
Returns the serialized instance
setCallbackAction()  : mixed
Sets the callback action
setChildNodes()  : mixed
Sets the child nodes collection
setClass()  : mixed
setIcon()  : mixed
setId()  : mixed
Sets the identifier
setLabel()  : mixed
setParentNode()  : mixed
Sets the parent node
setType()  : mixed
toArray()  : array
Returns the node in an array representation that can be used for serialization
unserialize()  : mixed
Create class state from serialized array.

Properties

$additionalData

protected array $additionalData = []

$callbackAction

Callback function that is called e.g after a click on the label

protected string $callbackAction = ''

$class

Node CSS Class

protected string $class = ''

$id

Node Identifier

protected string|int $id = ''

$label

Node Label

protected string $label = ''

$type

Node Type

protected string $type = ''

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(array $arrayRepresentation) : void

Parameters

$arrayRepresentation : array

Tags

throws
Exception

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

compareTo()

Compares a node to another one.

public compareTo(TreeNode $other) : int

Returns: 1 if its greater than the other one -1 if its smaller than the other one 0 if its equal

Parameters

$other : TreeNode

Return values

int —

See description above

dataFromArray()

Sets data of the node by a given data array

public dataFromArray(array $data) : mixed

Parameters

$data : array

equals()

Compares a node if it's identical to another node by the id property.

public equals(TreeNode $other) : bool

Parameters

$other : TreeNode

Return values

bool

getAdditionalData()

public getAdditionalData() : array

Return values

array

getCallbackAction()

Returns the callback action

public getCallbackAction() : string

Return values

string

getClass()

public getClass() : string

Return values

string

getId()

Returns the identifier

public getId() : string|int

Return values

string|int

getLabel()

public getLabel() : string

Return values

string

getType()

public getType() : string

Return values

string

hasChildNodes()

Returns TRUE if the node has child nodes attached

public hasChildNodes() : bool

Return values

bool

removeChildNodes()

Removes child nodes collection

public removeChildNodes() : mixed

serialize()

Returns the serialized instance

public serialize() : string

Tags

todo:

Drop method and \Serializable class interface in v12.

Return values

string

setCallbackAction()

Sets the callback action

public setCallbackAction(string $callbackAction) : mixed

Parameters

$callbackAction : string

setClass()

public setClass(string $class) : mixed

Parameters

$class : string

setIcon()

public setIcon(string|Icon $icon) : mixed

Parameters

$icon : string|Icon

setId()

Sets the identifier

public setId(string|int $id) : mixed

Parameters

$id : string|int

setLabel()

public setLabel(string $label) : mixed

Parameters

$label : string

setParentNode()

Sets the parent node

public setParentNode([TreeNode|null $parentNode = null ]) : mixed

Parameters

$parentNode : TreeNode|null = null

setType()

public setType(string $type) : mixed

Parameters

$type : string

toArray()

Returns the node in an array representation that can be used for serialization

public toArray([bool $addChildNodes = true ]) : array

Parameters

$addChildNodes : bool = true

Return values

array

unserialize()

Create class state from serialized array.

public unserialize(string $serializedString) : mixed

Parameters

$serializedString : string

Tags

throws
Exception

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

todo:

Drop method and \Serializable class interface in v12.

On this page