‪TYPO3CMS  10.4
TreeRepresentationNode.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
19 
24 {
30  protected ‪$label = '';
31 
37  protected ‪$type = '';
38 
44  protected ‪$class = '';
45 
51  protected ‪$icon = '';
52 
58  protected ‪$callbackAction = '';
59 
63  public function ‪setClass(‪$class)
64  {
65  $this->class = ‪$class;
66  }
67 
71  public function ‪getClass()
72  {
73  return ‪$this->class;
74  }
75 
79  public function ‪setIcon(‪$icon)
80  {
81  $this->icon = ‪$icon;
82  }
83 
87  public function ‪getIcon()
88  {
89  return ‪$this->icon;
90  }
91 
95  public function ‪setLabel(‪$label)
96  {
97  $this->label = ‪$label;
98  }
99 
103  public function ‪getLabel()
104  {
105  return ‪$this->label;
106  }
107 
111  public function ‪setType(‪$type)
112  {
113  $this->type = ‪$type;
114  }
115 
119  public function ‪getType()
120  {
121  return ‪$this->type;
122  }
123 
130  {
131  $this->callbackAction = ‪$callbackAction;
132  }
133 
139  public function ‪getCallbackAction()
140  {
142  }
143 
150  public function ‪toArray($addChildNodes = true)
151  {
152  $arrayRepresentation = parent::toArray();
153  $arrayRepresentation = array_merge($arrayRepresentation, [
154  'label' => $this->label,
155  'type' => $this->type,
156  'class' => $this->class,
157  'icon' => $this->icon,
158  'callbackAction' => $this->callbackAction
159  ]);
160  return $arrayRepresentation;
161  }
162 
168  public function ‪dataFromArray($data)
169  {
170  parent::dataFromArray($data);
171  $this->‪setLabel($data['label']);
172  $this->‪setType($data['type']);
173  $this->‪setClass($data['class']);
174  $this->‪setIcon($data['icon']);
175  $this->‪setCallbackAction($data['callbackAction']);
176  }
177 }
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\setClass
‪setClass($class)
Definition: TreeRepresentationNode.php:58
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\getClass
‪string getClass()
Definition: TreeRepresentationNode.php:66
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\$icon
‪string Icon $icon
Definition: TreeRepresentationNode.php:47
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\getLabel
‪string getLabel()
Definition: TreeRepresentationNode.php:98
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\dataFromArray
‪dataFromArray($data)
Definition: TreeRepresentationNode.php:163
‪TYPO3\CMS\Core\Imaging\Icon
Definition: Icon.php:26
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode
Definition: TreeRepresentationNode.php:24
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\setIcon
‪setIcon($icon)
Definition: TreeRepresentationNode.php:74
‪TYPO3\CMS\Backend\Tree
Definition: AbstractTree.php:16
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\$class
‪string $class
Definition: TreeRepresentationNode.php:41
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\setLabel
‪setLabel($label)
Definition: TreeRepresentationNode.php:90
‪TYPO3\CMS\Backend\Tree\TreeNode
Definition: TreeNode.php:25
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\$label
‪string $label
Definition: TreeRepresentationNode.php:29
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\getType
‪string getType()
Definition: TreeRepresentationNode.php:114
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\toArray
‪array toArray($addChildNodes=true)
Definition: TreeRepresentationNode.php:145
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\getCallbackAction
‪string getCallbackAction()
Definition: TreeRepresentationNode.php:134
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\$callbackAction
‪string $callbackAction
Definition: TreeRepresentationNode.php:53
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\setType
‪setType($type)
Definition: TreeRepresentationNode.php:106
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\setCallbackAction
‪setCallbackAction($callbackAction)
Definition: TreeRepresentationNode.php:124
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\getIcon
‪string Icon getIcon()
Definition: TreeRepresentationNode.php:82
‪TYPO3\CMS\Backend\Tree\TreeRepresentationNode\$type
‪string $type
Definition: TreeRepresentationNode.php:35