本文整理匯總了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']);