1 | <?php |
||
17 | class AggregationValue implements \ArrayAccess, \IteratorAggregate |
||
18 | { |
||
19 | const BUCKETS_KEY = 'buckets'; |
||
20 | const DOC_COUNT_KEY = 'doc_count'; |
||
21 | |||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | private $rawData; |
||
26 | |||
27 | public function __construct(array $rawData) |
||
31 | |||
32 | /** |
||
33 | * Returns aggregation value by the aggregation name. |
||
34 | */ |
||
35 | public function getValue(string $name) |
||
43 | |||
44 | public function getCount(): int |
||
48 | |||
49 | /** |
||
50 | * Returns array of bucket values. |
||
51 | * |
||
52 | * @return AggregationValue[] |
||
53 | */ |
||
54 | public function getBuckets(): array |
||
68 | |||
69 | /** |
||
70 | * Returns sub-aggregation. |
||
71 | */ |
||
72 | public function getAggregation(string $name): ?self |
||
80 | |||
81 | /** |
||
82 | * Search'es the aggregation by defined path. |
||
83 | */ |
||
84 | public function find(string $path): ?self |
||
95 | |||
96 | public function offsetExists($offset) |
||
100 | |||
101 | public function offsetGet($offset) |
||
109 | |||
110 | public function offsetSet($offset, $value) |
||
114 | |||
115 | public function offsetUnset($offset) |
||
119 | |||
120 | public function getIterator(): \ArrayIterator |
||
130 | } |
||
131 |