src/Charcoal/Source/Database/DatabaseFilter.php
protected function byFilters()
    {
        if (!$this->hasFilters()) {
            throw new UnexpectedValueException(
                'Filters can not be empty.'
            );
        }

        $conditions = [];
        foreach ($this->filters() as $filter) {
            if ($filter instanceof DatabaseExpressionInterface) {
                $filter = $filter->sql();
            }

            if (strlen($filter) > 0) {
                $conditions[] = $filter;
            }
        }

        return $this->compileConditions($conditions);
    }
protected function byFilters()
    {
        if (!$this->hasFilters()) {
            throw new UnexpectedValueException(
                'Filters can not be empty.'
            );
        }

        $conditions = [];
        foreach ($this->filters() as $filter) {
            if ($filter instanceof DatabaseExpressionInterface) {
                $filter = $filter->sql();
            }

            if (strlen($filter) > 0) {
                $conditions[] = $filter;
            }
        }

        return $this->compileConditions($conditions);
    }
protected function byFilters ( ) { if ( ! $ this -> hasFilters ( ) ) { throw new UnexpectedValueException ( 'Filters can not be empty.' ) ; } $ conditions = [ ] ; foreach ( $ this -> filters ( ) as $ filter ) { if ( $ filter instanceof DatabaseExpressionInterface ) { $ filter = $ filter -> sql ( ) ; } if ( strlen ( $ filter ) > 0 ) { $ conditions [ ] = $ filter ; } } return $ this -> compileConditions ( $ conditions ) ; }
Retrieve the correctly parenthesized and nested WHERE conditions.

@throws UnexpectedValueException If the custom condition is empty.
@return string
Retrieve the correctly parenthesized and nested WHERE conditions .