Checks if the given node id is an ancestor of
the current node.
public isAncestor ( integer $id ) : boolean | ||
$id | integer | |
Результат | boolean |
/** * Checks if the given node id is an ancestor of * the current node. * * @param int $id * @return bool */ public function isAncestor($id) { if (!is_null($this->parent)) { if ($this->parent->id() == $id) { return true; } return $this->parent->isAncestor($id); } return false; }