FOF30\Model\TreeModel::scopeAncestorsAndSelf PHP Method

scopeAncestorsAndSelf() protected method

get() will return all ancestor nodes and ourselves
protected scopeAncestorsAndSelf ( ) : void
return void
    protected function scopeAncestorsAndSelf()
    {
        $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));
    }