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