public function getName()
{
return $this->_name;
}
/** * Add a sub-aggregation * @throws \Elastica\Exception\InvalidException * * @param AbstractAggregation $aggregation * @return $this */ public function addAggregation(AbstractAggregation $aggregation) { if ($aggregation instanceof GlobalAggregation) { throw new InvalidException('Global aggregators can only be placed as top level aggregators'); } $this->_aggs[$aggregation->getName()] = $aggregation->toArray(); return $this; }