1 | <?php |
||
22 | class HistogramAggregation extends AbstractAggregation |
||
23 | { |
||
24 | use BucketingTrait; |
||
25 | |||
26 | const DIRECTION_ASC = 'asc'; |
||
27 | const DIRECTION_DESC = 'desc'; |
||
28 | |||
29 | /** |
||
30 | * @var int |
||
31 | */ |
||
32 | protected $interval; |
||
33 | |||
34 | /** |
||
35 | * @var int |
||
36 | */ |
||
37 | protected $minDocCount; |
||
38 | |||
39 | /** |
||
40 | * @var array |
||
41 | */ |
||
42 | protected $extendedBounds; |
||
43 | |||
44 | /** |
||
45 | * @var string |
||
46 | */ |
||
47 | protected $orderMode; |
||
48 | |||
49 | /** |
||
50 | * @var string |
||
51 | */ |
||
52 | protected $orderDirection; |
||
53 | |||
54 | /** |
||
55 | * @var bool |
||
56 | */ |
||
57 | protected $keyed; |
||
58 | |||
59 | /** |
||
60 | * Inner aggregations container init. |
||
61 | * |
||
62 | * @param string $name |
||
63 | * @param string $field |
||
64 | * @param int $interval |
||
65 | * @param int $minDocCount |
||
66 | * @param string $orderMode |
||
67 | * @param string $orderDirection |
||
68 | * @param int $extendedBoundsMin |
||
69 | * @param int $extendedBoundsMax |
||
70 | * @param bool $keyed |
||
71 | */ |
||
72 | public function __construct( |
||
92 | |||
93 | /** |
||
94 | * @return bool |
||
95 | */ |
||
96 | public function isKeyed() |
||
100 | |||
101 | /** |
||
102 | * Get response as a hash instead keyed by the buckets keys. |
||
103 | * |
||
104 | * @param bool $keyed |
||
105 | * |
||
106 | * @return $this |
||
107 | */ |
||
108 | public function setKeyed($keyed) |
||
114 | |||
115 | /** |
||
116 | * Sets buckets ordering. |
||
117 | * |
||
118 | * @param string $mode |
||
119 | * @param string $direction |
||
120 | * |
||
121 | * @return $this |
||
122 | */ |
||
123 | public function setOrder($mode, $direction = self::DIRECTION_ASC) |
||
130 | |||
131 | /** |
||
132 | * @return array |
||
133 | */ |
||
134 | public function getOrder() |
||
142 | |||
143 | /** |
||
144 | * @return int |
||
145 | */ |
||
146 | public function getInterval() |
||
150 | |||
151 | /** |
||
152 | * @param int $interval |
||
153 | * |
||
154 | * @return $this |
||
155 | */ |
||
156 | public function setInterval($interval) |
||
162 | |||
163 | /** |
||
164 | * @return int |
||
165 | */ |
||
166 | public function getMinDocCount() |
||
170 | |||
171 | /** |
||
172 | * Set limit for document count buckets should have. |
||
173 | * |
||
174 | * @param int $minDocCount |
||
175 | * |
||
176 | * @return $this |
||
177 | */ |
||
178 | public function setMinDocCount($minDocCount) |
||
184 | |||
185 | /** |
||
186 | * @return array |
||
187 | */ |
||
188 | public function getExtendedBounds() |
||
192 | |||
193 | /** |
||
194 | * @param int $min |
||
195 | * @param int $max |
||
196 | * |
||
197 | * @return $this |
||
198 | */ |
||
199 | public function setExtendedBounds($min = null, $max = null) |
||
212 | |||
213 | /** |
||
214 | * {@inheritdoc} |
||
215 | */ |
||
216 | public function getType() |
||
220 | |||
221 | /** |
||
222 | * {@inheritdoc} |
||
223 | */ |
||
224 | public function getArray() |
||
243 | |||
244 | /** |
||
245 | * Checks if all required parameters are set. |
||
246 | * |
||
247 | * @param array $data |
||
248 | * @param array $required |
||
249 | * |
||
250 | * @throws \LogicException |
||
251 | */ |
||
252 | protected function checkRequiredParameters($data, $required) |
||
258 | } |
||
259 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.