public function setCondition($condition)
    {
        if ($condition === null) {
            $this->condition = $condition;
            return $this;
        }

        if (!is_string($condition)) {
            throw new InvalidArgumentException(
                'Custom expression must be a string.'
            );
        }

        $condition = trim($condition);
        if ($condition === '') {
            $condition = null;
        }

        $this->condition = $condition;
        return $this;
    }