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;
    }