TYPO3 API  SVNRelease
class.t3lib_tree_tca_databasenode.php
Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003  *  Copyright notice
00004  *
00005  *  (c) 2010-2011 Steffen Ritter <info@steffen-ritter.net>
00006  *  All rights reserved
00007  *
00008  *  This script is part of the TYPO3 project. The TYPO3 project is
00009  *  free software; you can redistribute it and/or modify
00010  *  it under the terms of the GNU General Public License as published by
00011  *  the Free Software Foundation; either version 2 of the License, or
00012  *  (at your option) any later version.
00013  *
00014  *  The GNU General Public License can be found at
00015  *  http://www.gnu.org/copyleft/gpl.html.
00016  *  A copy is found in the textfile GPL.txt and important notices to the license
00017  *  from the author is found in LICENSE.txt distributed with these scripts.
00018  *
00019  *
00020  *  This script is distributed in the hope that it will be useful,
00021  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023  *  GNU General Public License for more details.
00024  *
00025  *  This copyright notice MUST APPEAR in all copies of the script!
00026  ***************************************************************/
00027 
00028 /**
00029  * Represents a node in a TCA database setup
00030  *
00031  * @author Steffen Ritter <info@steffen-ritter.net>
00032  * @package TYPO3
00033  * @subpackage t3lib_tree
00034  */
00035 
00036 class t3lib_tree_Tca_DatabaseNode extends t3lib_tree_RepresentationNode {
00037 
00038     /**
00039      * @var boolean
00040      */
00041     protected $selectable;
00042 
00043     /**
00044      * @var boolean
00045      */
00046     protected $selected = FALSE;
00047 
00048     /**
00049      * @var boolean
00050      */
00051     protected $expanded = TRUE;
00052 
00053     /**
00054      * @var boolean
00055      */
00056     protected $hasChildren = FALSE;
00057 
00058     /**
00059      * @var mixed
00060      */
00061     private $sortValue;
00062 
00063     /**
00064      * Sets the expand state
00065      *
00066      * @param  $expanded
00067      * @return void
00068      */
00069     public function setExpanded($expanded) {
00070         $this->expanded = $expanded;
00071     }
00072 
00073     /**
00074      * Gets the expand state
00075      *
00076      * @return bool
00077      */
00078     public function getExpanded() {
00079         return $this->expanded;
00080     }
00081 
00082     /**
00083      * Sets the selectable property
00084      *
00085      * @param  $selectable
00086      * @return void
00087      */
00088     public function setSelectable($selectable) {
00089         $this->selectable = $selectable;
00090     }
00091 
00092     /**
00093      * Gets the selectable property
00094      *
00095      * @return bool
00096      */
00097     public function getSelectable() {
00098         return $this->selectable;
00099     }
00100 
00101     /**
00102      * Sets the select state
00103      *
00104      * @param  $selected
00105      * @return void
00106      */
00107     public function setSelected($selected) {
00108         $this->selected = $selected;
00109     }
00110 
00111     /**
00112      * Gets the select state
00113      *
00114      * @return bool
00115      */
00116     public function getSelected() {
00117         return $this->selected;
00118     }
00119 
00120     /**
00121      * Gets the hasChildren property
00122      *
00123      * @return bool
00124      */
00125     public function hasChildren() {
00126         return $this->hasChildren;
00127     }
00128 
00129     /**
00130      * Sets the hasChildren property
00131      *
00132      * @param  $value
00133      * @return void
00134      */
00135     public function setHasChildren($value) {
00136         $this->hasChildren = (boolean) $value;
00137     }
00138 
00139     /**
00140      * Compares a node to another one.
00141      *
00142      * Returns:
00143      * 1 if its greater than the other one
00144      * -1 if its smaller than the other one
00145      * 0 if its equal
00146      *
00147      * @param t3lib_tree_Node $other
00148      * @return int see description above
00149      */
00150     public function compareTo($other) {
00151         if ($this->equals($other)) {
00152             return 0;
00153         }
00154 
00155         return ($this->sortValue > $other->getSortValue()) ? 1 : -1;
00156     }
00157 
00158     /**
00159      * Gets the sort value
00160      *
00161      * @return mixed
00162      */
00163     public function getSortValue() {
00164         return $this->sortValue;
00165     }
00166 
00167     /**
00168      * Sets the sort value
00169      *
00170      * @param mixed $sortValue
00171      * @return void
00172      */
00173     public function setSortValue($sortValue) {
00174         $this->sortValue = $sortValue;
00175     }
00176 
00177 }
00178 
00179 ?>