|
@@ 254-258 (lines=5) @@
|
| 251 |
|
$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]); |
| 252 |
|
} |
| 253 |
|
} |
| 254 |
|
else { |
| 255 |
|
foreach ($days as $day => $value) { |
| 256 |
|
$result[$year][$month][$day] = $keyed_units[$unit]->getDefaultValue(); |
| 257 |
|
} |
| 258 |
|
} |
| 259 |
|
} |
| 260 |
|
} |
| 261 |
|
|
|
@@ 286-289 (lines=4) @@
|
| 283 |
|
if (isset($db_events[$unit][Event::BAT_HOUR][$year][$month][$day][$hour])) { |
| 284 |
|
$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]); |
| 285 |
|
} |
| 286 |
|
else { |
| 287 |
|
// If nothing from db - then revert to the defaults |
| 288 |
|
$result[$year][$month][$day][$hour] = (int) $keyed_units[$unit]->getDefaultValue(); |
| 289 |
|
} |
| 290 |
|
} |
| 291 |
|
} |
| 292 |
|
} |
|
@@ 335-338 (lines=4) @@
|
| 332 |
|
if (isset($db_events[$unit][Event::BAT_MINUTE][$year][$month][$day][$hour][$minute])) { |
| 333 |
|
$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]); |
| 334 |
|
} |
| 335 |
|
else { |
| 336 |
|
// If nothing from db - then revert to the defaults |
| 337 |
|
$result[$year][$month][$day][$hour][$minute] = (int) $keyed_units[$unit]->getDefaultValue(); |
| 338 |
|
} |
| 339 |
|
} |
| 340 |
|
} |
| 341 |
|
} |