Skip to content
Snippets Groups Projects
Commit 4dd251a1 authored by Aivaras Gotovskis's avatar Aivaras Gotovskis
Browse files

Add constructor arguments to GeoBoundsAggregation.

parent 8d7e50bc
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,31 @@ class GeoDistanceAggregation extends AbstractAggregation
*/
private $ranges = [];
/**
* Inner aggregations container init.
*
* @param string $name
* @param string $field
* @param mixed $origin
* @param array $ranges
* @param string $unit
* @param string $distanceType
*/
public function __construct($name, $field = null, $origin = null, $ranges = [], $unit = null, $distanceType = null)
{
parent::__construct($name);
$this->setField($field);
$this->setOrigin($origin);
foreach ($ranges as $range) {
$from = isset($range['from']) ? $range['from'] : null;
$to = isset($range['to']) ? $range['to'] : null;
$this->addRange($from, $to);
}
$this->setUnit($unit);
$this->setDistanceType($distanceType);
}
/**
* @return string
*/
......
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