6 * Every node of a database object tree has to implement this interface.
8 * @author Matthias Schmidt
9 * @copyright 2001-2019 WoltLab GmbH
10 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
11 * @package WoltLabSuite\Core\Data
14 interface IObjectTreeNode
extends \Countable
, IIDObject
, \RecursiveIterator
17 * Adds the given node as child node and sets the child node's parent node to this node.
19 * @param IObjectTreeNode $child added child node
20 * @throws \InvalidArgumentException if given object is no (deocrated) instance of this class
22 public function addChild(self
$child);
25 * Returns the depth of the node within the tree.
27 * The minimum depth is `1`.
31 public function getDepth();
34 * Returns the number of open parent nodes.
38 public function getOpenParentNodes();
41 * Retruns the parent node of this node.
43 * @return static parent node
45 public function getParentNode();
48 * Returns `true` if this node is the last sibling and `false` otherwise.
52 public function isLastSibling();
55 * Sets the parent node of this node.
57 * @param IObjectTreeNode $parentNode parent node
58 * @throws \InvalidArgumentException if given object is no (deocrated) instance of this class
60 public function setParentNode(self
$parentNode);