Defines grouping rule.
@param string $rule
@param string $having Optional
@return Result fluent interface
432341
public function group($rule, $having = null){
		if($this->validateConditions())
			return $this;

		$this->resetState();
		$this->grouping = array($rule, $having);
		return $this;
	}
1069694
public function having($conditions, ...$parameters)
    {
        if (is_array($conditions)) {
            $this->having = array_merge($this->where, array_map(function ($value, $field) {
                return $field . '=' . $this->connection->quote($value);
            }, $conditions, array_keys($conditions)));
        } else {
            if ($parameters) {
                $conditions = $this->connection->merge($conditions, $parameters);
            }
            $this->having[] = $conditions;
        }

        return $this;
    }
967940
public function applyAggregate(DataQuery $query, $having)
    {
        $schema = DataObject::getSchema();
        $baseTable = $schema->baseDataTable($query->dataClass());

        return $query
            ->having($having)
            ->groupby("\"{$baseTable}\".\"ID\"");
    }
1233318
public function having($conditions, $params = array())
    {
        $this->mergeParams($params);
        $this->query['having'] = $this->buildConditions($conditions);

        return $this;
    }
189611
public function having($having)
    {
        if (! (func_num_args() === 1 && ($having instanceof Expr\Andx || $having instanceof Expr\Orx))) {
            $having = new Expr\Andx(func_get_args());
        }

        return $this->add('having', $having);
    }
382782
public function having( $expression ) {
		$this->expressionValidator->validate( $expression, ExpressionValidator::VALIDATE_FUNCTION );

		$this->usageValidator->trackUsedPrefixes( $expression );
		$this->usageValidator->trackUsedVariables( $expression );
		$this->modifiers['HAVING'] = '(' . $expression . ')';
	}
211781
public function setHaving($having)
    {
        $having = func_num_args() > 1 ? func_get_args() : $having;
        $this->having = array();
        return $this->addHaving($having);
    }
924989
public function having($condition = null) {
		$having = $this->get('having', array());
		if( !$condition ) {
			return $having;
		}
		$having[] = $condition;
		return $this->set('having', $having);
	}
753064
@NonNull
    @Override
    public Having having(@NonNull Expression expression) {
        if (expression == null) {
            throw new IllegalArgumentException("expression cannot be null.");
        }
        return new Having(this, expression);
    }
592891
public function having() {
        $args = func_get_args();
        $this->build()->bindExpression('having', $args[0] . $args[1] . ' ? ');
        $this->build()->bindParams('having', $args[2]);

        return $this->connection;
    }
1321555
public function andHaving($having)
    {
        $args   = func_get_args();
        $having = $this->getDQLPart('having');

        if ($having instanceof Expr\Andx) {
            $having->addMultiple($args);
        } else {
            array_unshift($args, $having);
            $having = new Expr\Andx($args);
        }

        return $this->add('having', $having);
    }
1370012
public function excludeByRule(Closure $rule)
    {
        $result = $this->target;

        foreach ($result as $key => $value) {
            if ($rule($key, $value)) {
                unset($result[$key]);
            }
        }

        return $result;
    }
755224
public function addRule(RuleAbstract $rule)
    {
        // TODO Keyframes with duplicate identifiers do NOT cascade!
        // Last one overwrites previous ones.
        // @see https://developer.mozilla.org/en-US/docs/Web/CSS/@keyframes#Duplicate_resolution

        if ($rule instanceof KeyframesRuleSet) {
            $this->rules[] = $rule;
        } else {
            throw new \InvalidArgumentException(
                "Invalid rule instance. Instance of 'KeyframesRuleSet' expected."
            );
        }

        return $this;
    }
1056804
public function assignHavingAppliers(HavingClauseStrategy $strategy)
    {
        if ($this->havingAppliers) {
            $items = $strategy->getHaving();

            $strategy->clearHaving();

            foreach ($this->havingAppliers as $applier) {
                $clause = $this->connection()->having();

                call_user_func_array($applier, [$clause]);

                $strategy->havingConditions($clause);
            }

            if ($items) {
                $clause = $this->connection()->having();

                foreach ($items as $where) {
                    $clause->addHaving($where['logic'], $where['sql'], $where['params']);
                }

                $strategy->havingConditions($clause);
            }
        }

        return $this;
    }
219405
public function rule($name, $rule='')
    {
        if (is_array($name)) {
            $this->rule=array_merge($this->rule, $name);
        } else {
            $this->rule[$name]=$rule;
        }
        return $this;
    }
669104
public function addRule($pattern, $replacement, $haveDelimiter = true)
    {
        if ($pattern && $replacement) {
            $this->pattern = $haveDelimiter ? '#' . $this->options['leftDelimiter'] . $pattern . $this->options['rightDelimiter'] . '#s' : "#{$pattern}#s";
            $this->replacement = $replacement;
        }
        return $this;
    }
1078731
protected function addRule(FilterRule $rule)
    {
        if ($this->keys === null) {
            $this->filter->addFilterRule($rule);
        }

        if (is_array($this->keys)) {
            foreach ($this->keys as $key) {
                $this->filter->addFilterRule($rule, $key);
            }
        } else {
            $this->filter->addFilterRule($rule, $this->keys);
        }

        return $this;
    }