public function is_descendant_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; }