src/ORM/DataQuery.php
public function removeFilterOn($fieldExpression)
    {
        $matched = false;

        // If given a parameterised condition extract only the condition
        if (is_array($fieldExpression)) {
            reset($fieldExpression);
            $fieldExpression = key($fieldExpression);
        }

        $where = $this->query->getWhere();
        // Iterate through each condition
        foreach ($where as $i => $condition) {
            // Rewrite condition groups as plain conditions before comparison
            if ($condition instanceof SQLConditionGroup) {
                $predicate = $condition->conditionSQL($parameters);
                $condition = array($predicate => $parameters);
            }

            // As each condition is a single length array, do a single
            // iteration to extract the predicate and parameters
            foreach ($condition as $predicate => $parameters) {
                // @see SQLSelect::addWhere for why this is required here
                if (strpos($predicate, $fieldExpression) !== false) {
                    unset($where[$i]);
                    $matched = true;
                }
                // Enforce single-item condition predicate => parameters structure
                break;
            }
        }

        // set the entire where clause back, but clear the original one first
        if ($matched) {
            $this->query->setWhere($where);
        } else {
            throw new InvalidArgumentException("Couldn't find $fieldExpression in the query filter.");
        }

        return $this;
    }
public function removeFilterOn($fieldExpression)
    {
        $matched = false;

        // If given a parameterised condition extract only the condition
        if (is_array($fieldExpression)) {
            reset($fieldExpression);
            $fieldExpression = key($fieldExpression);
        }

        $where = $this->query->getWhere();
        // Iterate through each condition
        foreach ($where as $i => $condition) {
            // Rewrite condition groups as plain conditions before comparison
            if ($condition instanceof SQLConditionGroup) {
                $predicate = $condition->conditionSQL($parameters);
                $condition = array($predicate => $parameters);
            }

            // As each condition is a single length array, do a single
            // iteration to extract the predicate and parameters
            foreach ($condition as $predicate => $parameters) {
                // @see SQLSelect::addWhere for why this is required here
                if (strpos($predicate, $fieldExpression) !== false) {
                    unset($where[$i]);
                    $matched = true;
                }
                // Enforce single-item condition predicate => parameters structure
                break;
            }
        }

        // set the entire where clause back, but clear the original one first
        if ($matched) {
            $this->query->setWhere($where);
        } else {
            throw new InvalidArgumentException("Couldn't find $fieldExpression in the query filter.");
        }

        return $this;
    }
public function removeFilterOn ( $ fieldExpression ) { $ matched = false ; // If given a parameterised condition extract only the condition if ( is_array ( $ fieldExpression ) ) { reset ( $ fieldExpression ) ; $ fieldExpression = key ( $ fieldExpression ) ; } $ where = $ this -> query -> getWhere ( ) ; // Iterate through each condition foreach ( $ where as $ i => $ condition ) { // Rewrite condition groups as plain conditions before comparison if ( $ condition instanceof SQLConditionGroup ) { $ predicate = $ condition -> conditionSQL ( $ parameters ) ; $ condition = array ( $ predicate => $ parameters ) ; } // As each condition is a single length array, do a single // iteration to extract the predicate and parameters foreach ( $ condition as $ predicate => $ parameters ) { // @see SQLSelect::addWhere for why this is required here if ( strpos ( $ predicate , $ fieldExpression ) !== false ) { unset ( $ where [ $ i ] ) ; $ matched = true ; } // Enforce single-item condition predicate => parameters structure break ; } } // set the entire where clause back, but clear the original one first if ( $ matched ) { $ this -> query -> setWhere ( $ where ) ; } else { throw new InvalidArgumentException ( "Couldn't find $fieldExpression in the query filter." ) ; } return $ this ; }
Remove a filter from the query

@param string|array $fieldExpression The predicate of the condition to remove
(ignoring parameters). The expression will be considered a match if it's
contained within any other predicate.
@return $this
Remove a filter from the query