public function allowMaxConditions($max)
    {
        if ($this->_maxConditions) {
            throw new BadMethodCallException('You can only set the maximum conditions only once.');
        }
        $this->_maxConditions = $max;
        $this->_allowNesting = false;
        $this->checkRestrictions();
        return $this;
    }