Ejemplo n.º 1
0
 public function searchFlights($mro)
 {
     try {
         //var_dump($mro);
         echo 'LMwebSoapClient searchFlights';
         $result = $this->sc->searchFlights(array('mro' => $mro->getParamsAsArray()))->return;
     } catch (Exception $ex) {
         echo $ex->getMessage();
         return null;
     }
     /*if ($result->flights->info == "NOHIT") {
           Template::errorTemplate("Keine Treffer gefunden");
           return null;
       }*/
     $flights = new Flights();
     $flights->setParamsByArray($result);
     //var_dump($result);
     $flightList = array();
     if ($result->flights->offers != null) {
         if (is_array($result->flights->flightList)) {
             foreach ($result->flights->flightList as $value) {
                 $flight = new Flight();
                 $flight->setParamsByArray($value);
                 array_push($flightList, $flight);
             }
         } else {
             $flight = new Flight();
             $flight->setParamsByArray($result->flights->flightList);
             array_push($flightList, $flight);
         }
     } else {
         // Template::errorTemplate("Keine Treffer gefunden");
         echo 'Keine Treffer gefunden';
         return null;
     }
     $flights->setFlightList($flightList);
     return $flights;
 }