*/
public function getOpenParentNodes();
+ /**
+ * Retruns the parent node of this node.
+ *
+ * @return static parent node
+ */
+ public function getParentNode();
+
/**
* Returns `true` if this node is the last sibling and `false` otherwise.
*
trait TObjectTreeNode {
/**
* child nodes
- * @var TObjectTreeNode[]
+ * @var static[]
*/
protected $children = [];
/**
* parent node object
- * @var TObjectTreeNode
+ * @var static
*/
protected $parentNode = null;
/**
* Return the currently iterated child node.
*
- * @return IObjectTreeNode
+ * @return static
*/
public function current() {
return $this->children[$this->index];
/**
* Returns an iterator for the currently iterated child node by returning the node itself.
*
- * @return IObjectTreeNode
+ * @return static
*/
public function getChildren() {
return $this->children[$this->index];
return $i;
}
+ /**
+ * Retruns the parent node of this node.
+ *
+ * @return static parent node
+ */
+ public function getParentNode() {
+ return $this->parentNode;
+ }
+
/**
* Returns `true` if the node as any children and return `false` otherwise.
*