10 defined(
'JPATH_PLATFORM') or die;
29 protected $_parent = null;
37 protected $_children = array();
44 public function __construct()
62 public function addChild(&$child)
66 if ($child instanceof Jnode)
68 $child->setParent($this);
83 public function setParent(&$parent)
87 if ($parent instanceof
JNode || is_null($parent))
89 $hash = spl_object_hash($this);
90 if (!is_null($this->_parent))
92 unset($this->_parent->children[$hash]);
94 if (!is_null($parent))
96 $parent->_children[$hash] = & $this;
98 $this->_parent = & $parent;
109 public function &getChildren()
113 return $this->_children;
123 public function &getParent()
127 return $this->_parent;
137 public function hasChildren()
141 return (
bool) count($this->_children);
151 public function hasParent()
155 return $this->getParent() != null;