Skip to content

Commit

Permalink
Merge pull request #157 from einorler/filter_agg_getter
Browse files Browse the repository at this point in the history
Added a getter for a filter in filter aggregation
  • Loading branch information
saimaz authored Sep 22, 2016
2 parents 23913d1 + a48c2a6 commit d823229
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Aggregation/Bucketing/FilterAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ public function setFilter(BuilderInterface $filter)
$this->filter = $filter;
}

/**
* Returns a filter.
*
* @return BuilderInterface
*/
public function getFilter()
{
return $this->filter;
}

/**
* {@inheritdoc}
*/
Expand All @@ -71,7 +81,7 @@ public function getArray()
throw new \LogicException("Filter aggregation `{$this->getName()}` has no filter added");
}

return $this->filter->toArray();
return $this->getFilter()->toArray();
}

/**
Expand Down

0 comments on commit d823229

Please # to comment.