public function createHourlyGranular(\DatePeriod $period, \DateTime $period_start)
{
$itemized = array();
$counter = (int) $period_start->format('i');
$start_minute = $counter;
foreach ($period as $minute) {
// Doing minutes so set the values in the minute array
$itemized[EventItemizer::BAT_MINUTE][$minute->format('Y')][$minute->format('n')]['d' . $minute->format('j')]['h' . $minute->format('G')]['m' . $minute->format('i')] = $this->event->getValue();
// Let the hours know that it cannot determine availability
$itemized[EventItemizer::BAT_HOUR][$minute->format('Y')][$minute->format('n')]['d' . $minute->format('j')]['h' . $minute->format('G')] = -1;
$counter++;
if ($counter == 60 && $start_minute !== 0) {
// Not a real hour - leave as is and move on
$counter = 0;
$start_minute = 0;
} elseif ($counter == 60 && $start_minute == 0) {
// Did a real whole hour so initialize the hour
$itemized[EventItemizer::BAT_HOUR][$minute->format('Y')][$minute->format('n')]['d' . $minute->format('j')]['h' . $minute->format('G')] = $this->event->getValue();
$counter = 0;
$start_minute = 0;
}
}
return $itemized;
}