FOF30\Model\TreeModel::scopeAncestors PHP Method

scopeAncestors() protected method

get() will return all ancestor nodes but not ourselves
protected scopeAncestors ( ) : void
return void
    protected function scopeAncestors()
    {
        $this->treeNestedGet = true;
        $db = $this->getDbo();
        $fldLft = $db->qn($this->getFieldAlias('lft'));
        $fldRgt = $db->qn($this->getFieldAlias('rgt'));
        $this->whereRaw($db->qn('parent') . '.' . $fldLft . ' > ' . $db->qn('node') . '.' . $fldLft);
        $this->whereRaw($db->qn('parent') . '.' . $fldLft . ' < ' . $db->qn('node') . '.' . $fldRgt);
        $this->whereRaw($db->qn('parent') . '.' . $fldLft . ' = ' . $db->q($this->lft));
    }