本文整理匯總了PHP中Flight::setParamsByArray方法的典型用法代碼示例。如果您正苦於以下問題:PHP Flight::setParamsByArray方法的具體用法?PHP Flight::setParamsByArray怎麽用?PHP Flight::setParamsByArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Flight
的用法示例。
在下文中一共展示了Flight::setParamsByArray方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: searchFlights
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;
}