当前位置: 首页>>代码示例>>PHP>>正文


PHP Schedule::fetchSchedule方法代码示例

本文整理汇总了PHP中Schedule::fetchSchedule方法的典型用法代码示例。如果您正苦于以下问题:PHP Schedule::fetchSchedule方法的具体用法?PHP Schedule::fetchSchedule怎么用?PHP Schedule::fetchSchedule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Schedule的用法示例。


在下文中一共展示了Schedule::fetchSchedule方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Connection

 function get_Schedule($id, $ident)
 {
     global $globalDebug;
     // Get schedule here, so it's done only one time
     $Connection = new Connection();
     $dbc = $Connection->db;
     $Spotter = new Spotter($dbc);
     $Schedule = new Schedule($dbc);
     $Translation = new Translation($dbc);
     $operator = $Spotter->getOperator($ident);
     if ($Schedule->checkSchedule($operator) == 0) {
         $operator = $Translation->checkTranslation($ident);
         if ($Schedule->checkSchedule($operator) == 0) {
             $schedule = $Schedule->fetchSchedule($operator);
             if (count($schedule) > 0) {
                 if ($globalDebug) {
                     echo "-> Schedule info for " . $operator . " (" . $ident . ")\n";
                 }
                 $this->all_flights[$id] = array_merge($this->all_flights[$id], array('departure_airport_time' => $schedule['DepartureTime']));
                 $this->all_flights[$id] = array_merge($this->all_flights[$id], array('arrival_airport_time' => $schedule['ArrivalTime']));
                 // FIXME : Check if route schedule = route from DB
                 if ($schedule['DepartureAirportIATA'] != '') {
                     if ($this->all_flights[$id]['departure_airport'] != $Spotter->getAirportIcao($schedule['DepartureAirportIATA'])) {
                         $airport_icao = $Spotter->getAirportIcao($schedule['DepartureAirportIATA']);
                         if ($airport_icao != '') {
                             $this->all_flights[$id]['departure_airport'] = $airport_icao;
                             if ($globalDebug) {
                                 echo "-> Change departure airport to " . $airport_icao . " for " . $ident . "\n";
                             }
                         }
                     }
                 }
                 if ($schedule['ArrivalAirportIATA'] != '') {
                     if ($this->all_flights[$id]['arrival_airport'] != $Spotter->getAirportIcao($schedule['ArrivalAirportIATA'])) {
                         $airport_icao = $Spotter->getAirportIcao($schedule['ArrivalAirportIATA']);
                         if ($airport_icao != '') {
                             $this->all_flights[$id]['arrival_airport'] = $airport_icao;
                             if ($globalDebug) {
                                 echo "-> Change arrival airport to " . $airport_icao . " for " . $ident . "\n";
                             }
                         }
                     }
                 }
                 $Schedule->addSchedule($operator, $this->all_flights[$id]['departure_airport'], $this->all_flights[$id]['departure_airport_time'], $this->all_flights[$id]['arrival_airport'], $this->all_flights[$id]['arrival_airport_time'], $schedule['Source']);
             }
         }
     }
     //$Connection->db = null;
 }
开发者ID:sysrun,项目名称:FlightAirMap,代码行数:49,代码来源:class.SpotterImport.php

示例2: get_Schedule

 static function get_Schedule($id, $ident)
 {
     global $globalDebug;
     // Get schedule here, so it's done only one time
     $operator = Spotter::getOperator($ident);
     if (Schedule::checkSchedule($operator) == 0) {
         $operator = Translation::checkTranslation($ident);
         if (Schedule::checkSchedule($operator) == 0) {
             $schedule = Schedule::fetchSchedule($operator);
             if (count($schedule) > 0) {
                 if ($globalDebug) {
                     echo "-> Schedule info for " . $operator . " (" . $ident . ")\n";
                 }
                 self::$all_flights[$id] = array_merge(self::$all_flights[$id], array('departure_airport_time' => $schedule['DepartureTime']));
                 self::$all_flights[$id] = array_merge(self::$all_flights[$id], array('arrival_airport_time' => $schedule['ArrivalTime']));
                 // FIXME : Check if route schedule = route from DB
                 if ($schedule['DepartureAirportIATA'] != '') {
                     if (self::$all_flights[$id]['departure_airport'] != Spotter::getAirportIcao($schedule['DepartureAirportIATA'])) {
                         $airport_icao = Spotter::getAirportIcao($schedule['DepartureAirportIATA']);
                         if ($airport_icao != '') {
                             self::$all_flights[$id]['departure_airport'] = $airport_icao;
                             if ($globalDebug) {
                                 echo "-> Change departure airport to " . $airport_icao . " for " . $ident . "\n";
                             }
                         }
                     }
                 }
                 if ($schedule['ArrivalAirportIATA'] != '') {
                     if (self::$all_flights[$id]['arrival_airport'] != Spotter::getAirportIcao($schedule['ArrivalAirportIATA'])) {
                         $airport_icao = Spotter::getAirportIcao($schedule['ArrivalAirportIATA']);
                         if ($airport_icao != '') {
                             self::$all_flights[$id]['arrival_airport'] = $airport_icao;
                             if ($globalDebug) {
                                 echo "-> Change arrival airport to " . $airport_icao . " for " . $ident . "\n";
                             }
                         }
                     }
                 }
                 Schedule::addSchedule($operator, self::$all_flights[$id]['departure_airport'], self::$all_flights[$id]['departure_airport_time'], self::$all_flights[$id]['arrival_airport'], self::$all_flights[$id]['arrival_airport_time'], $schedule['Source']);
             }
         }
     }
 }
开发者ID:kletellier,项目名称:FlightAirMap,代码行数:43,代码来源:class.SBS.php


注:本文中的Schedule::fetchSchedule方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。