90dc112bf73ef4364b5728fad14b2f277ae8d293
[Packages/TYPO3.CMS.git] / t3lib / tree / tca / class.t3lib_tree_tca_databasenode.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2010 Steffen Ritter <info@steffen-ritter.net>
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 * A copy is found in the textfile GPL.txt and important notices to the license
17 * from the author is found in LICENSE.txt distributed with these scripts.
18 *
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27
28 /**
29 * Represents a node in a TCA database setup
30 *
31 * @author Steffen Ritter <info@steffen-ritter.net>
32 * @package TYPO3
33 * @subpackage t3lib_tree
34 */
35
36 class t3lib_tree_Tca_DatabaseNode extends t3lib_tree_RepresentationNode {
37
38 /**
39 * @var boolean
40 */
41 protected $selectable;
42
43 /**
44 * @var boolean
45 */
46 protected $selected = FALSE;
47
48 /**
49 * @var boolean
50 */
51 protected $expanded = TRUE;
52
53 /**
54 * @var boolean
55 */
56 protected $hasChildren = FALSE;
57
58 /**
59 * @var mixed
60 */
61 private $sortValue;
62
63 /**
64 * Sets the expand state
65 *
66 * @param $expanded
67 * @return void
68 */
69 public function setExpanded($expanded) {
70 $this->expanded = $expanded;
71 }
72
73 /**
74 * Gets the expand state
75 *
76 * @return bool
77 */
78 public function getExpanded() {
79 return $this->expanded;
80 }
81
82 /**
83 * Sets the selectable property
84 *
85 * @param $selectable
86 * @return void
87 */
88 public function setSelectable($selectable) {
89 $this->selectable = $selectable;
90 }
91
92 /**
93 * Gets the selectable property
94 *
95 * @return bool
96 */
97 public function getSelectable() {
98 return $this->selectable;
99 }
100
101 /**
102 * Sets the select state
103 *
104 * @param $selected
105 * @return void
106 */
107 public function setSelected($selected) {
108 $this->selected = $selected;
109 }
110
111 /**
112 * Gets the select state
113 *
114 * @return bool
115 */
116 public function getSelected() {
117 return $this->selected;
118 }
119
120 /**
121 * Gets the hasChildren property
122 *
123 * @return bool
124 */
125 public function hasChildren() {
126 return $this->hasChildren;
127 }
128
129 /**
130 * Sets the hasChildren property
131 *
132 * @param $value
133 * @return void
134 */
135 public function setHasChildren($value) {
136 $this->hasChildren = (boolean) $value;
137 }
138
139 /**
140 * Compares with another nide, used for sorting
141 *
142 * @param $other node object
143 * @return int
144 */
145 public function compareTo($other) {
146 if ($this->sortValue > $other->sortValue) {
147 return 1;
148 } elseif ($this->sortValue < $other->sortValue) {
149 return -1;
150 } else {
151 return 0;
152 }
153 }
154
155 /**
156 * Gets the sort value
157 *
158 * @return mixed
159 */
160 public function getSortValue() {
161 return $this->sortValue;
162 }
163
164 /**
165 * Sets the sort value
166 *
167 * @param mixed $sortValue
168 * @return void
169 */
170 public function setSortValue($sortValue) {
171 $this->sortValue = $sortValue;
172 }
173
174 }
175
176 ?>