Habari\Term::ancestors PHP Method

ancestors() public method

Find this Term's ancestors.
public ancestors ( ) : Array
return Array Direct ancestors from the root to this Term in descendant order.
    public function ancestors()
    {
        $params = array('vocab_id' => $this->vocabulary_id, 'left' => $this->mptt_left, 'right' => $this->mptt_right);
        $query = 'SELECT * FROM {terms} WHERE vocabulary_id=:vocab_id AND mptt_left<:left AND mptt_right>:right ORDER BY mptt_left ASC';
        return DB::get_results($query, $params, 'Term');
    }