1 | <?php |
||
17 | class AggregationValue implements \ArrayAccess, \IteratorAggregate |
||
18 | { |
||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | private $rawData; |
||
23 | |||
24 | /** |
||
25 | * Constructor. |
||
26 | * |
||
27 | * @param array $rawData |
||
28 | */ |
||
29 | public function __construct($rawData) |
||
33 | |||
34 | /** |
||
35 | * Returns aggregation value by name. |
||
36 | * |
||
37 | * @param string $name |
||
38 | * |
||
39 | * @return array |
||
40 | */ |
||
41 | public function getValue($name) |
||
49 | |||
50 | /** |
||
51 | * Returns array of bucket values. |
||
52 | * |
||
53 | * @return AggregationValue[]|null |
||
54 | */ |
||
55 | public function getBuckets() |
||
69 | |||
70 | /** |
||
71 | * Returns sub-aggregation. |
||
72 | * |
||
73 | * @param string $name |
||
74 | * |
||
75 | * @return AggregationValue|null |
||
76 | */ |
||
77 | public function getAggregation($name) |
||
85 | |||
86 | /** |
||
87 | * Applies path method to aggregations. |
||
88 | * |
||
89 | * @param string $path |
||
90 | * |
||
91 | * @return AggregationValue|null |
||
92 | */ |
||
93 | public function find($path) |
||
104 | |||
105 | /** |
||
106 | * {@inheritdoc} |
||
107 | */ |
||
108 | public function offsetExists($offset) |
||
112 | |||
113 | /** |
||
114 | * {@inheritdoc} |
||
115 | */ |
||
116 | public function offsetGet($offset) |
||
124 | |||
125 | /** |
||
126 | * {@inheritdoc} |
||
127 | */ |
||
128 | public function offsetSet($offset, $value) |
||
132 | |||
133 | /** |
||
134 | * {@inheritdoc} |
||
135 | */ |
||
136 | public function offsetUnset($offset) |
||
140 | |||
141 | /** |
||
142 | * {@inheritdoc} |
||
143 | */ |
||
144 | public function getIterator() |
||
154 | } |
||
155 |