public is_ancestor_of ( |
||
$term | ||
Результат | boolean | true if $term is a descendant of $this |
public function is_ancestor_of(Term $term)
{
if ($this->vocabulary_id != $term->vocabulary_id) {
return false;
}
if ($this->mptt_left < $term->mptt_left && $this->mptt_right > $term->mptt_right) {
return true;
}
return false;
}