public function getCalendarsForStopPointAndTimetable(
        $externalCoverageId,
        $timetable,
        $stopPointInstance
    ) {
        $notesComputed = array();
        $calendarsSorted = array();
        // indicates whether to aggregate or dispatch notes
        $layout = $timetable->getLineConfig()->getLayoutConfig();
        $calendarsData = $this->navitia->getStopPointCalendarsData(
            $externalCoverageId,
            $timetable->getExternalRouteId(),
            $stopPointInstance->getExternalId()
        );
        if (isset($calendarsData->calendars)) {
            $calendarsSorted = $this->sortCalendars($calendarsData->calendars);
        }
        // calendar blocks are defined on route/timetable level
        if (count($timetable->getBlocks()) > 0) {
            foreach ($timetable->getBlocks() as $block) {
                if ($block->getTypeId() == 'calendar') {
                    $calendar = $this->findCalendar($block->getContent(), $calendarsSorted);
                    $stopSchedulesData = $this->navitia->getCalendarStopSchedulesByRoute(
                        $externalCoverageId,
                        $timetable->getExternalRouteId(),
                        $stopPointInstance->getExternalId(),
                        $block->getContent()
                    );
                    $calendar = $this->duplicateCalendarsInterpretion($calendar, $calendarsSorted, $block);
                    $calendar = $this->addSchedulesToCalendar(
                        $calendar,
                        $stopSchedulesData->stop_schedules
                    );
                    $calendar->schedules->additional_informations = $this->generateAdditionalInformations($calendar->schedules->additional_informations);
                    $calendar->notes = $this->purgeAnnotationsNotUsed(
                        $stopSchedulesData,
                        $timetable->getLineConfig()->getLayoutConfig()
                    );
                    $notesComputed = $this->computeNotes(
                        $timetable->getLineConfig(),
                        $notesComputed,
                        $calendar,
                        $layout->aggregatesNotes()
                    );
                }
            }
        }

        return array('calendars' => $calendarsSorted, 'notes' => $notesComputed);
    }
public function getCalendarsForStopPointAndTimetable(
        $externalCoverageId,
        $timetable,
        $stopPointInstance
    ) {
        $notesComputed = array();
        $calendarsSorted = array();
        // indicates whether to aggregate or dispatch notes
        $layout = $timetable->getLineConfig()->getLayoutConfig();
        $calendarsData = $this->navitia->getStopPointCalendarsData(
            $externalCoverageId,
            $timetable->getExternalRouteId(),
            $stopPointInstance->getExternalId()
        );
        if (isset($calendarsData->calendars)) {
            $calendarsSorted = $this->sortCalendars($calendarsData->calendars);
        }
        // calendar blocks are defined on route/timetable level
        if (count($timetable->getBlocks()) > 0) {
            foreach ($timetable->getBlocks() as $block) {
                if ($block->getTypeId() == 'calendar') {
                    $calendar = $this->findCalendar($block->getContent(), $calendarsSorted);
                    $stopSchedulesData = $this->navitia->getCalendarStopSchedulesByRoute(
                        $externalCoverageId,
                        $timetable->getExternalRouteId(),
                        $stopPointInstance->getExternalId(),
                        $block->getContent()
                    );
                    $calendar = $this->duplicateCalendarsInterpretion($calendar, $calendarsSorted, $block);
                    $calendar = $this->addSchedulesToCalendar(
                        $calendar,
                        $stopSchedulesData->stop_schedules
                    );
                    $calendar->schedules->additional_informations = $this->generateAdditionalInformations($calendar->schedules->additional_informations);
                    $calendar->notes = $this->purgeAnnotationsNotUsed(
                        $stopSchedulesData,
                        $timetable->getLineConfig()->getLayoutConfig()
                    );
                    $notesComputed = $this->computeNotes(
                        $timetable->getLineConfig(),
                        $notesComputed,
                        $calendar,
                        $layout->aggregatesNotes()
                    );
                }
            }
        }

        return array('calendars' => $calendarsSorted, 'notes' => $notesComputed);
    }
public function getCalendarsForStopPointAndTimetable ( $ externalCoverageId , $ timetable , $ stopPointInstance ) { $ notesComputed = array ( ) ; $ calendarsSorted = array ( ) ; // indicates whether to aggregate or dispatch notes $ layout = $ timetable -> getLineConfig ( ) -> getLayoutConfig ( ) ; $ calendarsData = $ this -> navitia -> getStopPointCalendarsData ( $ externalCoverageId , $ timetable -> getExternalRouteId ( ) , $ stopPointInstance -> getExternalId ( ) ) ; if ( isset ( $ calendarsData -> calendars ) ) { $ calendarsSorted = $ this -> sortCalendars ( $ calendarsData -> calendars ) ; } // calendar blocks are defined on route/timetable level if ( count ( $ timetable -> getBlocks ( ) ) > 0 ) { foreach ( $ timetable -> getBlocks ( ) as $ block ) { if ( $ block -> getTypeId ( ) == 'calendar' ) { $ calendar = $ this -> findCalendar ( $ block -> getContent ( ) , $ calendarsSorted ) ; $ stopSchedulesData = $ this -> navitia -> getCalendarStopSchedulesByRoute ( $ externalCoverageId , $ timetable -> getExternalRouteId ( ) , $ stopPointInstance -> getExternalId ( ) , $ block -> getContent ( ) ) ; $ calendar = $ this -> duplicateCalendarsInterpretion ( $ calendar , $ calendarsSorted , $ block ) ; $ calendar = $ this -> addSchedulesToCalendar ( $ calendar , $ stopSchedulesData -> stop_schedules ) ; $ calendar -> schedules -> additional_informations = $ this -> generateAdditionalInformations ( $ calendar -> schedules -> additional_informations ) ; $ calendar -> notes = $ this -> purgeAnnotationsNotUsed ( $ stopSchedulesData , $ timetable -> getLineConfig ( ) -> getLayoutConfig ( ) ) ; $ notesComputed = $ this -> computeNotes ( $ timetable -> getLineConfig ( ) , $ notesComputed , $ calendar , $ layout -> aggregatesNotes ( ) ) ; } } } return array ( 'calendars' => $ calendarsSorted , 'notes' => $ notesComputed ) ; }
Returns Calendars enhanced with schedules for a stop point and a route
Datetimes are parsed and response formatted for template
Only calendars added to timetable are kept

@param String $externalCoverageId
@param Object $timetable
@param Object $stopPointInstance

@return object
Returns Calendars enhanced with schedules for a stop point and a route Datetimes are parsed and response formatted for template Only calendars added to timetable are kept