當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Reservation::setConsumer方法代碼示例

本文整理匯總了PHP中Reservation::setConsumer方法的典型用法代碼示例。如果您正苦於以下問題:PHP Reservation::setConsumer方法的具體用法?PHP Reservation::setConsumer怎麽用?PHP Reservation::setConsumer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Reservation的用法示例。


在下文中一共展示了Reservation::setConsumer方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getStationObjByName

 $consumer->setEmail($_POST['clientEmail']);
 $consumer->setTelephone($_POST['clientTel']);
 $consumer->setType(getConsumerTypeByName($_POST['clientType']));
 EManager::getEntityManager()->persist($consumer);
 EManager::getEntityManager()->flush();
 $station_depart = getStationObjByName($_POST['depart']);
 $station_destination = getStationObjByName($_POST['destination']);
 $reservation = new Reservation();
 $format = 'Y-m-d H:i';
 $date_depart = DateTime::createFromFormat($format, $_POST['clientPickUP'] . ' ' . $_POST['clientPickTimeHUP'] . ':' . $_POST['clientPickTimeMUP']);
 $date_retour;
 if ($_POST['retour'] == "Aller-Retour") {
     $date_retour = DateTime::createFromFormat($format, $_POST['clientPickBackUP'] . ' ' . $_POST['clientPickBackTimeHUP'] . ':' . $_POST['clientPickBackTimeMUP']);
     $reservation->setReturnDate($date_retour);
 }
 $reservation->setConsumer($consumer);
 $reservation->setStationFrom($station_depart);
 $reservation->setStationTo($station_destination);
 $reservation->setStatus(getNonConfirmedReservationStatus());
 $reservation->setPickupDate($date_depart);
 $reservation->setNbrPassengers(getValidatedPassager());
 $tarif = getTarif($_POST['passager'], $station_depart->getName(), $station_destination->getName());
 if (is_object($tarif)) {
     if ($_POST['retour'] == "Aller-Retour") {
         $reservation->setPriceTotal($tarif->getTarif() * 2);
     } else {
         $reservation->setPriceTotal($tarif->getTarif());
     }
 }
 if (isset($_POST['extra'])) {
     $reservation->setExtra($_POST['extra']);
開發者ID:anouarattn,項目名稱:projet_nabil,代碼行數:31,代碼來源:processReservation.php


注:本文中的Reservation::setConsumer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。