예제 #1
0
파일: stations.php 프로젝트: Tjoosten/iRail
 /**
  * @param $id
  * @param $lang
  * @return Station
  * @throws Exception
  */
 public static function getStationFromID($id, $lang)
 {
     $stationobject = irail\stations\Stations::getStationFromID($id);
     if ($stationobject) {
         return stations::transformNewToOldStyle($stationobject, $lang);
     } else {
         throw new Exception("Error: could not find a station with id " . $stationobject->{"@id"} . ".", 300);
     }
 }
예제 #2
0
파일: stations.php 프로젝트: jncn/iRail
 /**
  * @param $id
  * @param $lang
  * @return Station
  * @throws Exception
  */
 public static function getStationFromID($id, $lang)
 {
     $stationobject = irail\stations\Stations::getStationFromID($id);
     if ($stationobject) {
         return self::transformNewToOldStyle($stationobject, $lang);
     } else {
         throw new Exception('Could not find a station with id ' . $id . '.', 404);
     }
 }