@@ -12,50 +12,50 @@ interface NestedSetInterface {
1212 *
1313 * @param \PNX\NestedSet\Node $target
1414 * The target node to insert below.
15- * @param \PNX\NestedSet\Node $node
16- * The node to insert. Only id and revision ID are required.
15+ * @param \PNX\NestedSet\NodeKey $nodeKey
16+ * The node to insert.
1717 *
1818 * @return \PNX\NestedSet\Node
1919 * Returns a new node with position values set.
2020 */
21- public function addNodeBelow (Node $ target , Node $ node );
21+ public function addNodeBelow (Node $ target , NodeKey $ nodeKey );
2222
2323 /**
2424 * Inserts a node before the target node.
2525 *
2626 * @param \PNX\NestedSet\Node $target
2727 * The target node to insert before.
28- * @param \PNX\NestedSet\Node $node
29- * The node to insert. Only id and revision ID are required .
28+ * @param \PNX\NestedSet\NodeKey $nodeKey
29+ * The node key to insert.
3030 *
3131 * @return \PNX\NestedSet\Node
3232 * Returns a node with position values set.
3333 */
34- public function addNodeBefore (Node $ target , Node $ node );
34+ public function addNodeBefore (Node $ target , NodeKey $ nodeKey );
3535
3636 /**
3737 * Inserts a node after the target node.
3838 *
3939 * @param \PNX\NestedSet\Node $target
4040 * The target node to insert after.
41- * @param \PNX\NestedSet\Node $node
42- * The node to insert. Only id and revision ID are required .
41+ * @param \PNX\NestedSet\NodeKey $nodeKey
42+ * The node key to insert.
4343 *
4444 * @return \PNX\NestedSet\Node
4545 * Returns a node with position values set.
4646 */
47- public function addNodeAfter (Node $ target , Node $ node );
47+ public function addNodeAfter (Node $ target , NodeKey $ nodeKey );
4848
4949 /**
5050 * Inserts a root node.
5151 *
52- * @param \PNX\NestedSet\Node $node
53- * The root node.
52+ * @param \PNX\NestedSet\NodeKey $nodeKey
53+ * The node key to insert .
5454 *
5555 * @return \PNX\NestedSet\Node
5656 * A new node with position values set.
5757 */
58- public function addRootNode (Node $ node );
58+ public function addRootNode (NodeKey $ nodeKey );
5959
6060 /**
6161 * Deletes a node and moves descendants up a level.
@@ -76,61 +76,59 @@ public function deleteSubTree(Node $node);
7676 /**
7777 * Finds all descendants of a node.
7878 *
79- * @param \PNX\NestedSet\Node $node
80- * The node.
79+ * @param \PNX\NestedSet\NodeKey $nodeKey
80+ * The node key to find descendants for .
8181 * @param int $depth
8282 * (optional) A depth limit. Defaults to 0, no limit.
8383 *
8484 * @return array
85- * The nested array of descendants.
85+ * The nested array of descendants.
8686 */
87- public function findDescendants (Node $ node , $ depth = 0 );
87+ public function findDescendants (NodeKey $ nodeKey , $ depth = 0 );
8888
8989 /**
9090 * Finds all immediate children of a node.
9191 *
92- * @param \PNX\NestedSet\Node $node
93- * The node.
92+ * @param \PNX\NestedSet\NodeKey $nodeKey
93+ * The node key to find children for .
9494 *
9595 * @return array
9696 * The children.
9797 */
98- public function findChildren (Node $ node );
98+ public function findChildren (NodeKey $ nodeKey );
9999
100100 /**
101101 * Finds all ancestors of a node.
102102 *
103- * @param \PNX\NestedSet\Node $node
104- * The node.
103+ * @param \PNX\NestedSet\NodeKey $nodeKey
104+ * The node to find ancestors for .
105105 *
106106 * @return array
107107 * The ancestors.
108108 */
109- public function findAncestors (Node $ node );
109+ public function findAncestors (NodeKey $ nodeKey );
110110
111111 /**
112112 * Finds the parent node.
113113 *
114- * @param \PNX\NestedSet\Node $node
115- * The node.
114+ * @param \PNX\NestedSet\NodeKey $nodeKey
115+ * The node key .
116116 *
117- * @return Node
117+ * @return \PNX\NestedSet\ Node
118118 * The parent node.
119119 */
120- public function findParent (Node $ node );
120+ public function findParent (NodeKey $ nodeKey );
121121
122122 /**
123123 * Gets a node for the ID and Revision ID.
124124 *
125- * @param int|string $id
126- * The ID.
127- * @param int|string $revision_id
128- * The revision ID.
125+ * @param NodeKey $nodeKey
126+ * The node key.
129127 *
130128 * @return \PNX\NestedSet\Node
131- * The node.
129+ * The node.
132130 */
133- public function getNode ($ id , $ revision_id );
131+ public function getNode (NodeKey $ nodeKey );
134132
135133 /**
136134 * Moves a subtree to be a new root of the tree.
@@ -189,4 +187,15 @@ public function getNodeAtPosition($left);
189187 */
190188 public function getTree ();
191189
190+ /**
191+ * Finds the root node for this node.
192+ *
193+ * @param \PNX\NestedSet\NodeKey $nodeKey
194+ * The node key.
195+ *
196+ * @return \PNX\NestedSet\Node
197+ * The root node.
198+ */
199+ public function findRoot (NodeKey $ nodeKey );
200+
192201}
0 commit comments