Exemplo n.º 1
0
 function __construct($from, $to, $time, $date, $timeSel, $results = 6, $lang = "EN", $format = "xml", $typeOfTransport = "all")
 {
     parent::__construct($format, $lang);
     if ($from == "" || $to == "") {
         throw new Exception("No stations specified");
     }
     //TODO: check on input
     $this->results = $results;
     $this->from = $from;
     $this->to = $to;
     $this->time = $time;
     $this->date = $date;
     $this->timeSel = $timeSel;
     $this->typeOfTransport = $typeOfTransport;
     //check for ID
     if (sizeof(explode(".", $from)) > 1) {
         $si = new StationsInput();
         $station = $si->getStationFromId($from, $this);
         $this->from = $station->getName();
     }
     if (sizeof(explode(".", $to)) > 1) {
         $si = new StationsInput();
         $station = $si->getStationFromId($to, $this);
         $this->to = $station->getName();
     }
 }
Exemplo n.º 2
0
 function __construct($station, $date, $time, $arrdep = "DEP", $lang = "EN", $format = "xml", $isId = false)
 {
     parent::__construct($format, $lang);
     if (!$isId) {
         $this->station = $station;
     } else {
         $stin = new StationsInput();
         $this->station = $stin->getStationFromId($station, $this)->getName();
     }
     $this->date = $date;
     $this->time = $time;
     $this->arrdep = $arrdep;
 }