private function sortCalendars($calendars)
    {
        $calendarsSorted = array();
        foreach ($calendars as $calendar) {
            $calendarsSorted[$calendar->id] = $calendar;
            $calendarsSorted[$calendar->id]->week_pattern = (array) $calendarsSorted[$calendar->id]->week_pattern;
        }

        return $calendarsSorted;
    }
private function sortCalendars($calendars)
    {
        $calendarsSorted = array();
        foreach ($calendars as $calendar) {
            $calendarsSorted[$calendar->id] = $calendar;
            $calendarsSorted[$calendar->id]->week_pattern = (array) $calendarsSorted[$calendar->id]->week_pattern;
        }

        return $calendarsSorted;
    }
private function sortCalendars ( $ calendars ) { $ calendarsSorted = array ( ) ; foreach ( $ calendars as $ calendar ) { $ calendarsSorted [ $ calendar -> id ] = $ calendar ; $ calendarsSorted [ $ calendar -> id ] -> week_pattern = ( array ) $ calendarsSorted [ $ calendar -> id ] -> week_pattern ; } return $ calendarsSorted ; }
Index calendars by Id and cast week_patterns into array for templates
Index calendars by Id and cast week_patterns into array for templates