public function &where($pattern, ...$arguments)
    {
        if (empty($pattern)) {
            throw new InvalidArgumentException('Pattern argument is required');
        }

        if (is_string($pattern)) {
            $this->conditions[] = $this->connection->prepareConditions(array_merge([$pattern], $arguments));
        } elseif (is_array($pattern)) {
            if (!empty($arguments)) {
                throw new LogicException('When pattern is an array, no extra arguments are allowed');
            }

            $this->conditions[] = $this->connection->prepareConditions($pattern);
        } else {
            throw new InvalidArgumentException('Pattern can be string or an array');
        }

        // Force rebuild of conditions as string on next getConditions() call
        $this->conditions_as_string = false;

        return $this;
    }