Skip to content
Snippets Groups Projects
Commit a925ec07 authored by Simonas Šerlinskas's avatar Simonas Šerlinskas
Browse files

restored aggregation prefix fo sub aggregations

parent 3b023fb4
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,8 @@ abstract class AbstractAggregation implements BuilderInterface
use ParametersTrait;
use NameAwareTrait;
const PREFIX = 'agg_';
/**
* @var string
*/
......@@ -53,7 +55,7 @@ abstract class AbstractAggregation implements BuilderInterface
*/
public function __construct($name)
{
$this->setName($name);
$this->setName(self::PREFIX.$name);
}
/**
......@@ -100,6 +102,20 @@ abstract class AbstractAggregation implements BuilderInterface
}
}
/**
* Returns sub aggregation.
*
* @return AbstractAggregation
*/
public function getAggregation($name)
{
if ($this->aggregations && $this->aggregations->has(self::PREFIX.$name)) {
return $this->aggregations->get(self::PREFIX.$name);
} else {
return [];
}
}
/**
* {@inheritdoc}
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment