@@ 238-242 (lines=5) @@ | ||
235 | $result[$year][$month][$day] = ((int)$db_events[$unit][Event::BAT_DAY][$year][$month][$day] == 0 ? $keyed_units[$unit]->getDefaultValue() : (int)$db_events[$unit][Event::BAT_DAY][$year][$month][$day]); |
|
236 | } |
|
237 | } |
|
238 | else { |
|
239 | foreach ($days as $day => $value) { |
|
240 | $result[$year][$month][$day] = $keyed_units[$unit]->getDefaultValue(); |
|
241 | } |
|
242 | } |
|
243 | } |
|
244 | } |
|
245 | ||
@@ 270-273 (lines=4) @@ | ||
267 | if (isset($db_events[$unit][Event::BAT_HOUR][$year][$month][$day][$hour])) { |
|
268 | $result[$year][$month][$day][$hour] = ((int) $db_events[$unit][Event::BAT_HOUR][$year][$month][$day][$hour] == 0 ? $keyed_units[$unit]->getDefaultValue() : (int) $db_events[$unit][Event::BAT_HOUR][$year][$month][$day][$hour]); |
|
269 | } |
|
270 | else { |
|
271 | // If nothing from db - then revert to the defaults |
|
272 | $result[$year][$month][$day][$hour] = (int) $keyed_units[$unit]->getDefaultValue(); |
|
273 | } |
|
274 | } |
|
275 | } |
|
276 | } |
|
@@ 319-322 (lines=4) @@ | ||
316 | if (isset($db_events[$unit][Event::BAT_MINUTE][$year][$month][$day][$hour][$minute])) { |
|
317 | $result[$year][$month][$day][$hour][$minute] = ((int) $db_events[$unit][Event::BAT_MINUTE][$year][$month][$day][$hour][$minute] == 0 ? $keyed_units[$unit]->getDefaultValue() : (int) $db_events[$unit][Event::BAT_MINUTE][$year][$month][$day][$hour][$minute]); |
|
318 | } |
|
319 | else { |
|
320 | // If nothing from db - then revert to the defaults |
|
321 | $result[$year][$month][$day][$hour][$minute] = (int) $keyed_units[$unit]->getDefaultValue(); |
|
322 | } |
|
323 | } |
|
324 | } |
|
325 | } |