From 088a5b31c22f8e008cede07699d1d4e0a6241a76 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mantas=20Jonu=C5=A1as?= <mantas.jonusas@nfq.lt>
Date: Mon, 23 Mar 2015 13:16:57 +0200
Subject: [PATCH] Updated if conditional

---
 Aggregation/DateRangeAggregation.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Aggregation/DateRangeAggregation.php b/Aggregation/DateRangeAggregation.php
index 034b1fd..a82050f 100644
--- a/Aggregation/DateRangeAggregation.php
+++ b/Aggregation/DateRangeAggregation.php
@@ -79,7 +79,7 @@ class DateRangeAggregation extends AbstractAggregation
      */
     public function getArray()
     {
-        if ($this->getField() && $this->getFormat() && $this->ranges) {
+        if ($this->getField() && $this->getFormat() && !empty($this->ranges)) {
             $data = [
                 'format' => $this->getFormat(),
                 'field' => $this->getField(),
-- 
GitLab