1 | <?php |
||
19 | class GeoBoundsAggregation extends AbstractAggregation |
||
20 | { |
||
21 | use BucketingTrait; |
||
22 | |||
23 | /** |
||
24 | * @var bool |
||
25 | */ |
||
26 | private $wrapLongitude = true; |
||
27 | |||
28 | /** |
||
29 | * @return bool |
||
30 | */ |
||
31 | public function isWrapLongitude() |
||
35 | |||
36 | /** |
||
37 | * @param bool $wrapLongitude |
||
38 | */ |
||
39 | public function setWrapLongitude($wrapLongitude) |
||
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | */ |
||
47 | public function getArray() |
||
48 | { |
||
49 | $data = []; |
||
50 | if ($this->getField()) { |
||
51 | $data['field'] = $this->getField(); |
||
52 | } else { |
||
53 | throw new \LogicException('Geo bounds aggregation must have a field set.'); |
||
54 | } |
||
55 | |||
56 | $data['wrap_longitude'] = $this->isWrapLongitude(); |
||
57 | |||
58 | return $data; |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | public function getType() |
||
68 | } |
||
69 |