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

changed return value to null for getAggregation if there is no agg

parent a925ec07
No related branches found
No related tags found
No related merge requests found
......@@ -104,15 +104,16 @@ abstract class AbstractAggregation implements BuilderInterface
/**
* Returns sub aggregation.
* @param string $name Aggregation name to return.
*
* @return AbstractAggregation
* @return AbstractAggregation|null
*/
public function getAggregation($name)
{
if ($this->aggregations && $this->aggregations->has(self::PREFIX.$name)) {
return $this->aggregations->get(self::PREFIX.$name);
} else {
return [];
return null;
}
}
......
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