Gdn_SQLDriver::_where PHP Method

_where() protected method

It should be used only in conjunction with methods that properly escape the sql.
protected _where ( string $Sql ) : Gdn_SQLDriver
$Sql string The condition to add.
return Gdn_SQLDriver $this
    protected function _where($Sql)
    {
        // Figure out the concatenation operator.
        $Concat = '';
        if ($this->_OpenWhereGroupCount > 0) {
            $this->_WhereConcat = $this->_WhereGroupConcat;
        }
        if (count($this->_Wheres) > 0) {
            $Concat = str_repeat(' ', $this->_WhereGroupCount + 1) . $this->_WhereConcat . ' ';
        }
        // Open the group(s) if necessary.
        while ($this->_OpenWhereGroupCount > 0) {
            $Concat .= '(';
            $this->_OpenWhereGroupCount--;
        }
        // Revert the concat back to 'and'.
        $this->_WhereConcat = $this->_WhereConcatDefault;
        $this->_WhereGroupConcat = $this->_WhereGroupConcatDefault;
        $this->_Wheres[] = $Concat . $Sql;
        return $this;
    }