Skip to content
Snippets Groups Projects
Commit 7e3fc57c authored by alex's avatar alex
Browse files

Fixes nested and reverse nested aggregation requirements

parent cc1442e3
No related branches found
No related tags found
No related merge requests found
......@@ -71,6 +71,10 @@ class NestedAggregation extends AbstractAggregation
*/
public function getArray()
{
if (count($this->getAggregations()) == 0) {
throw new \LogicException("Nested aggregation `{$this->getName()}` has no aggregations added");
}
return ['path' => $this->getPath()];
}
}
......@@ -71,10 +71,6 @@ class ReverseNestedAggregation extends AbstractAggregation
*/
public function getArray()
{
if (count($this->getAggregations()) == 0) {
throw new \LogicException("Reverse Nested aggregation `{$this->getName()}` has no aggregations added");
}
$output = new \stdClass();
if ($this->getPath()) {
$output = ['path' => $this->getPath()];
......
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