private function prepareCondition($condition)
    {
        if (!is_array($condition)) {
            $condition = ['in' => [$condition]];
        }

        $conditionKeys = array_keys($condition);

        if (is_integer(current($conditionKeys))) {
            $condition = ['in' => $condition];
        }

        foreach ($condition as $key => $value) {
            if (!isset($this->mappedConditions[$key]) && !in_array($key, $this->rangeConditions)) {
                throw new \LogicException("Condition {$key} is not supported.");
            }

            if (isset($this->mappedConditions[$key])) {
                $condition[$this->mappedConditions[$key]] = $value;
                unset($condition[$key]);
            }

            if (in_array($key, $this->negativeConditions)) {
                $condition['negative'] = true;
            }
        }

        return $condition;
    }
private function prepareCondition($condition)
    {
        if (!is_array($condition)) {
            $condition = ['in' => [$condition]];
        }

        $conditionKeys = array_keys($condition);

        if (is_integer(current($conditionKeys))) {
            $condition = ['in' => $condition];
        }

        foreach ($condition as $key => $value) {
            if (!isset($this->mappedConditions[$key]) && !in_array($key, $this->rangeConditions)) {
                throw new \LogicException("Condition {$key} is not supported.");
            }

            if (isset($this->mappedConditions[$key])) {
                $condition[$this->mappedConditions[$key]] = $value;
                unset($condition[$key]);
            }

            if (in_array($key, $this->negativeConditions)) {
                $condition['negative'] = true;
            }
        }

        return $condition;
    }
private function prepareCondition ( $ condition ) { if ( ! is_array ( $ condition ) ) { $ condition = [ 'in' => [ $ condition ] ] ; } $ conditionKeys = array_keys ( $ condition ) ; if ( is_integer ( current ( $ conditionKeys ) ) ) { $ condition = [ 'in' => $ condition ] ; } foreach ( $ condition as $ key => $ value ) { if ( ! isset ( $ this -> mappedConditions [ $ key ] ) && ! in_array ( $ key , $ this -> rangeConditions ) ) { throw new \ LogicException ( "Condition {$key} is not supported." ) ; } if ( isset ( $ this -> mappedConditions [ $ key ] ) ) { $ condition [ $ this -> mappedConditions [ $ key ] ] = $ value ; unset ( $ condition [ $ key ] ) ; } if ( in_array ( $ key , $ this -> negativeConditions ) ) { $ condition [ 'negative' ] = true ; } } return $ condition ; }
Ensure the condition is supported and try to tranform it into a supported type.

@param array|integer|string $condition Parsed condition.

@return array
Ensure the condition is supported and try to tranform it into a supported type .