src/Charcoal/Source/Database/DatabaseFilter.php
public function sql()
    {
        if ($this->active()) {
            if ($this->hasFilters()) {
                $sql = $this->byFilters();
                if ($this->isNegating()) {
                    return $this->operator().' '.$sql;
                }
                return $sql;
            }

            if ($this->hasCondition()) {
                $sql = $this->byCondition();
                if ($this->isNegating()) {
                    return $this->operator().' ('.$sql.')';
                }
                return $sql;
            }

            if ($this->hasFields()) {
                return $this->byPredicate();
            }
        }

        return '';
    }
public function sql()
    {
        if ($this->active()) {
            if ($this->hasFilters()) {
                $sql = $this->byFilters();
                if ($this->isNegating()) {
                    return $this->operator().' '.$sql;
                }
                return $sql;
            }

            if ($this->hasCondition()) {
                $sql = $this->byCondition();
                if ($this->isNegating()) {
                    return $this->operator().' ('.$sql.')';
                }
                return $sql;
            }

            if ($this->hasFields()) {
                return $this->byPredicate();
            }
        }

        return '';
    }
public function sql ( ) { if ( $ this -> active ( ) ) { if ( $ this -> hasFilters ( ) ) { $ sql = $ this -> byFilters ( ) ; if ( $ this -> isNegating ( ) ) { return $ this -> operator ( ) . ' ' . $ sql ; } return $ sql ; } if ( $ this -> hasCondition ( ) ) { $ sql = $ this -> byCondition ( ) ; if ( $ this -> isNegating ( ) ) { return $ this -> operator ( ) . ' (' . $ sql . ')' ; } return $ sql ; } if ( $ this -> hasFields ( ) ) { return $ this -> byPredicate ( ) ; } } return '' ; }
Converts the filter into a SQL expression for the WHERE clause.

@return string A SQL string fragment.
Converts the filter into a SQL expression for the WHERE clause .