TYPO3 CMS  TYPO3_8-7
DatabaseTreeNode.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  */
16 
21 {
25  protected $selectable;
26 
30  protected $selected = false;
31 
35  protected $expanded = true;
36 
40  protected $hasChildren = false;
41 
45  private $sortValue;
46 
52  public function setExpanded($expanded)
53  {
54  $this->expanded = $expanded;
55  }
56 
62  public function getExpanded()
63  {
64  return $this->expanded;
65  }
66 
72  public function setSelectable($selectable)
73  {
74  $this->selectable = $selectable;
75  }
76 
82  public function getSelectable()
83  {
84  return $this->selectable;
85  }
86 
92  public function setSelected($selected)
93  {
94  $this->selected = $selected;
95  }
96 
102  public function getSelected()
103  {
104  return $this->selected;
105  }
106 
112  public function hasChildren()
113  {
114  return $this->hasChildren;
115  }
116 
122  public function setHasChildren($value)
123  {
124  $this->hasChildren = (bool)$value;
125  }
126 
138  public function compareTo($other)
139  {
140  if ($this->equals($other)) {
141  return 0;
142  }
143  return $this->sortValue > $other->getSortValue() ? 1 : -1;
144  }
145 
151  public function getSortValue()
152  {
153  return $this->sortValue;
154  }
155 
161  public function setSortValue($sortValue)
162  {
163  $this->sortValue = $sortValue;
164  }
165 }
equals(\TYPO3\CMS\Backend\Tree\TreeNode $other)
Definition: TreeNode.php:150