File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -132,4 +132,48 @@ public function selected(): array
132132 }
133133 return explode (' ' , $ result );
134134 }
135+
136+ /**
137+ * Returns the ID of the parent of item.
138+ *
139+ * @return string The ID or empty string.
140+ */
141+ public function getParentItemId (string $ itemId ): string
142+ {
143+ return $ this ->call ('parent ' , $ itemId );
144+ }
145+
146+ public function isRootItem (string $ itemId ): bool
147+ {
148+ return $ this ->getParentItemId ($ itemId ) === '' ;
149+ }
150+
151+ /**
152+ * Returns the ID of item's next sibling.
153+ *
154+ * @return string the ID or empty string.
155+ */
156+ public function getNextItemId (string $ itemId ): string
157+ {
158+ return $ this ->call ('next ' , $ itemId );
159+ }
160+
161+ /**
162+ * Returns the ID of item's previous sibling.
163+ *
164+ * @return string the ID or empty string.
165+ */
166+ public function getPrevItemId (string $ itemId ): string
167+ {
168+ return $ this ->call ('prev ' , $ itemId );
169+ }
170+
171+ /**
172+ * Sets the viewport to the specified item.
173+ */
174+ public function seeItemId (string $ itemId ): static
175+ {
176+ $ this ->call ('see ' , $ itemId );
177+ return $ this ;
178+ }
135179}
You can’t perform that action at this time.
0 commit comments