Skip to content
Snippets Groups Projects
Unverified Commit 18e1f105 authored by Simonas Šerlinskas's avatar Simonas Šerlinskas Committed by GitHub
Browse files

fixes #237 - added support for date range keys (#252)

(cherry picked from commit 8458ac9)
parent ce0875f1
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,8 @@ class DateRangeAggregation extends AbstractAggregation
foreach ($ranges as $range) {
$from = isset($range['from']) ? $range['from'] : null;
$to = isset($range['to']) ? $range['to'] : null;
$this->addRange($from, $to);
$key = isset($range['key']) ? $range['key'] : null;
$this->addRange($from, $to, $key);
}
}
......@@ -78,12 +79,13 @@ class DateRangeAggregation extends AbstractAggregation
*
* @throws \LogicException
*/
public function addRange($from = null, $to = null)
public function addRange($from = null, $to = null, $key = null)
{
$range = array_filter(
[
'from' => $from,
'to' => $to,
'key' => $key,
]
);
......
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