private function itemizeDays($db_events, $itemized, $unit, $keyed_units) {
    $result = array();

    foreach ($itemized[Event::BAT_DAY] as $year => $months) {
      foreach ($months as $month => $days) {
        // Check if month is defined in DB otherwise set to default value
        if (isset($db_events[$unit][Event::BAT_DAY][$year][$month])) {
          foreach ($days as $day => $value) {
            $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]);
          }
        }
        else {
          foreach ($days as $day => $value) {
            $result[$year][$month][$day] = $keyed_units[$unit]->getDefaultValue();
          }
        }
      }
    }

    return $result;
  }
private function itemizeDays($db_events, $itemized, $unit, $keyed_units) {
    $result = array();

    foreach ($itemized[Event::BAT_DAY] as $year => $months) {
      foreach ($months as $month => $days) {
        // Check if month is defined in DB otherwise set to default value
        if (isset($db_events[$unit][Event::BAT_DAY][$year][$month])) {
          foreach ($days as $day => $value) {
            $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]);
          }
        }
        else {
          foreach ($days as $day => $value) {
            $result[$year][$month][$day] = $keyed_units[$unit]->getDefaultValue();
          }
        }
      }
    }

    return $result;
  }
private function itemizeDays ( $ db_events , $ itemized , $ unit , $ keyed_units ) { $ result = array ( ) ; foreach ( $ itemized [ Event :: BAT_DAY ] as $ year => $ months ) { foreach ( $ months as $ month => $ days ) { // Check if month is defined in DB otherwise set to default value if ( isset ( $ db_events [ $ unit ] [ Event :: BAT_DAY ] [ $ year ] [ $ month ] ) ) { foreach ( $ days as $ day => $ value ) { $ 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 ] ) ; } } else { foreach ( $ days as $ day => $ value ) { $ result [ $ year ] [ $ month ] [ $ day ] = $ keyed_units [ $ unit ] -> getDefaultValue ( ) ; } } } } return $ result ; }
Helper function that cycles through db results and setups the BAT_DAY itemized array

@param $db_events
@param $itemized
@param $unit
@param $keyed_units

@return array
Helper function that cycles through db results and setups the BAT_DAY itemized array