|
@@ 227-231 (lines=5) @@
|
| 224 |
|
$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]); |
| 225 |
|
} |
| 226 |
|
} |
| 227 |
|
else { |
| 228 |
|
foreach ($days as $day => $value) { |
| 229 |
|
$result[$year][$month][$day] = $keyed_units[$unit]->getDefaultValue(); |
| 230 |
|
} |
| 231 |
|
} |
| 232 |
|
} |
| 233 |
|
} |
| 234 |
|
|
|
@@ 258-261 (lines=4) @@
|
| 255 |
|
if (isset($db_events[$unit][Event::BAT_HOUR][$year][$month][$day][$hour])) { |
| 256 |
|
$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]); |
| 257 |
|
} |
| 258 |
|
else { |
| 259 |
|
// If nothing from db - then revert to the defaults |
| 260 |
|
$result[$year][$month][$day][$hour] = (int) $keyed_units[$unit]->getDefaultValue(); |
| 261 |
|
} |
| 262 |
|
} |
| 263 |
|
} |
| 264 |
|
} |
|
@@ 305-308 (lines=4) @@
|
| 302 |
|
if (isset($db_events[$unit][Event::BAT_MINUTE][$year][$month][$day][$hour][$minute])) { |
| 303 |
|
$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]); |
| 304 |
|
} |
| 305 |
|
else { |
| 306 |
|
// If nothing from db - then revert to the defaults |
| 307 |
|
$result[$year][$month][$day][$hour][$minute] = (int) $keyed_units[$unit]->getDefaultValue(); |
| 308 |
|
} |
| 309 |
|
} |
| 310 |
|
} |
| 311 |
|
} |