‪TYPO3CMS  9.5
TreeRepresentationNode.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
17 
22 {
28  protected ‪$label = '';
29 
35  protected ‪$type = '';
36 
42  protected ‪$class = '';
43 
49  protected ‪$icon = '';
50 
56  protected ‪$callbackAction = '';
57 
61  public function ‪setClass(‪$class)
62  {
63  $this->class = ‪$class;
64  }
65 
69  public function ‪getClass()
70  {
71  return ‪$this->class;
72  }
73 
77  public function ‪setIcon(‪$icon)
78  {
79  $this->icon = ‪$icon;
80  }
81 
85  public function ‪getIcon()
86  {
87  return ‪$this->icon;
88  }
89 
93  public function ‪setLabel(‪$label)
94  {
95  $this->label = ‪$label;
96  }
97 
101  public function ‪getLabel()
102  {
103  return ‪$this->label;
104  }
105 
109  public function ‪setType(‪$type)
110  {
111  $this->type = ‪$type;
112  }
113 
117  public function ‪getType()
118  {
119  return ‪$this->type;
120  }
121 
128  {
129  $this->callbackAction = ‪$callbackAction;
130  }
131 
137  public function ‪getCallbackAction()
138  {
140  }
141 
148  public function ‪toArray($addChildNodes = true)
149  {
150  $arrayRepresentation = parent::toArray();
151  $arrayRepresentation = array_merge($arrayRepresentation, [
152  'label' => $this->label,
153  'type' => $this->type,
154  'class' => $this->class,
155  'icon' => $this->icon,
156  'callbackAction' => $this->callbackAction
157  ]);
158  return $arrayRepresentation;
159  }
160 
166  public function ‪dataFromArray($data)
167  {
168  parent::dataFromArray($data);
169  $this->‪setLabel($data['label']);
170  $this->‪setType($data['type']);
171  $this->‪setClass($data['class']);
172  $this->‪setIcon($data['icon']);
173  $this->‪setCallbackAction($data['callbackAction']);
174  }
175 }
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\setClass
‪setClass($class)
Definition: TreeRepresentationNode.php:56
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\getClass
‪string getClass()
Definition: TreeRepresentationNode.php:64
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\getLabel
‪string getLabel()
Definition: TreeRepresentationNode.php:96
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\dataFromArray
‪dataFromArray($data)
Definition: TreeRepresentationNode.php:161
‪TYPO3\CMS\Core\Imaging\Icon
Definition: Icon.php:25
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode
Definition: TreeRepresentationNode.php:22
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\setIcon
‪setIcon($icon)
Definition: TreeRepresentationNode.php:72
‪TYPO3\CMS\Backend\Tree
Definition: AbstractTree.php:2
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\$class
‪string $class
Definition: TreeRepresentationNode.php:39
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\setLabel
‪setLabel($label)
Definition: TreeRepresentationNode.php:88
‪TYPO3\CMS\Backend\Tree\TreeNode
Definition: TreeNode.php:23
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\$label
‪string $label
Definition: TreeRepresentationNode.php:27
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\getType
‪string getType()
Definition: TreeRepresentationNode.php:112
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\toArray
‪array toArray($addChildNodes=true)
Definition: TreeRepresentationNode.php:143
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\$icon
‪string $icon
Definition: TreeRepresentationNode.php:45
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\getCallbackAction
‪string getCallbackAction()
Definition: TreeRepresentationNode.php:132
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\$callbackAction
‪string $callbackAction
Definition: TreeRepresentationNode.php:51
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\setType
‪setType($type)
Definition: TreeRepresentationNode.php:104
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\setCallbackAction
‪setCallbackAction($callbackAction)
Definition: TreeRepresentationNode.php:122
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\getIcon
‪string Icon getIcon()
Definition: TreeRepresentationNode.php:80
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\$type
‪string $type
Definition: TreeRepresentationNode.php:33