@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | { |
48 | 48 | // don't return query if searchString is empty |
49 | 49 | if (empty($searchString)) { |
50 | - return null; |
|
50 | + return NULL; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | $searchString = $this->escapeQuery(trim($searchString)); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $query['body']['query']['bool']['minimum_should_match'] = "1"; // 1 |
58 | 58 | $query['body']['query']['bool']['should'][1]['has_child']['child_type'] = "datastream"; // 1 |
59 | 59 | |
60 | - $query = $this->resultsFilter($query, false); |
|
60 | + $query = $this->resultsFilter($query, FALSE); |
|
61 | 61 | |
62 | 62 | return $query; |
63 | 63 | |
@@ -85,13 +85,13 @@ discard block |
||
85 | 85 | |
86 | 86 | } elseif (!empty($qry) && $key == 'from') { |
87 | 87 | |
88 | - if ($dateTime = $this->convertFormDate($qry, false)) { |
|
88 | + if ($dateTime = $this->convertFormDate($qry, FALSE)) { |
|
89 | 89 | $filter['gte'] = $dateTime->format('Y-m-d'); |
90 | 90 | } |
91 | 91 | |
92 | 92 | } elseif (!empty($qry) && $key == 'till') { |
93 | 93 | |
94 | - if ($dateTime = $this->convertFormDate($qry, true)) { |
|
94 | + if ($dateTime = $this->convertFormDate($qry, TRUE)) { |
|
95 | 95 | $filter['lte'] = $dateTime->format('Y-m-d'); |
96 | 96 | } |
97 | 97 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | |
105 | 105 | } |
106 | 106 | |
107 | - $showDeleted = ($searchArray['showDeleted'] == 'true') ? true : false; |
|
107 | + $showDeleted = ($searchArray['showDeleted'] == 'true') ? TRUE : FALSE; |
|
108 | 108 | $query = $this->resultsFilter($query, $showDeleted); |
109 | 109 | return $query; |
110 | 110 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @param array Elasticsearch query array |
116 | 116 | * @return array Elasticsearch queryFilter array |
117 | 117 | */ |
118 | - public function resultsFilter($query, $showDeleted = false) |
|
118 | + public function resultsFilter($query, $showDeleted = FALSE) |
|
119 | 119 | { |
120 | 120 | |
121 | 121 | $queryFilter = array(); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | if ($searchResultsFilter['from']) { |
143 | 143 | |
144 | 144 | $from = date('d.m.Y', $searchResultsFilter['from']); |
145 | - $dateTime = $this->convertFormDate($from, false); |
|
145 | + $dateTime = $this->convertFormDate($from, FALSE); |
|
146 | 146 | $dateFilter['gte'] = $dateTime->format('Y-m-d'); |
147 | 147 | unset($searchResultsFilter['from']); |
148 | 148 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | if ($searchResultsFilter['till']) { |
152 | 152 | |
153 | 153 | $till = date('d.m.Y', $searchResultsFilter['till']); |
154 | - $dateTime = $this->convertFormDate($till, true); |
|
154 | + $dateTime = $this->convertFormDate($till, TRUE); |
|
155 | 155 | $dateFilter['lte'] = $dateTime->format('Y-m-d'); |
156 | 156 | unset($searchResultsFilter['till']); |
157 | 157 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | } |
175 | 175 | |
176 | 176 | // document must be active |
177 | - if($showDeleted == false) { |
|
177 | + if($showDeleted == FALSE) { |
|
178 | 178 | |
179 | 179 | $queryFilter['body']['query']['bool']['must'][]['term']['STATE'] = 'A'; |
180 | 180 | |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | * @param bool $intervalEnd Fills missing values with the maximum possible date if true |
201 | 201 | * @return DateTime Determined date |
202 | 202 | */ |
203 | - public function convertFormDate($dateString, $intervalEnd = false) |
|
203 | + public function convertFormDate($dateString, $intervalEnd = FALSE) |
|
204 | 204 | { |
205 | 205 | try { |
206 | 206 | if (strlen($dateString) == 4) { |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | return new \DateTime($dateString); |
214 | 214 | } |
215 | 215 | } catch (Exception $_) { |
216 | - return false; |
|
216 | + return FALSE; |
|
217 | 217 | } |
218 | 218 | } |
219 | 219 |