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


PHP Customer::addCustomer方法代碼示例

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


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

示例1: anyConfirmed

 /**
  * Function to create the appointment, scrub the database, and send out an email confirmation
  *
  * User interaction is complete
  *
  **/
 public function anyConfirmed()
 {
     // When this boolean is set to True, instead of deleting all appointment times for the package duration
     // It will instead remove all times up to the end of the day, and continue to the next day until the package
     // time is done.
     $overlapDays = FALSE;
     $info = Session::get('appointmentInfo');
     $startTime = new DateTime($info['datetime']);
     $endTime = new DateTime($info['datetime']);
     date_add($endTime, date_interval_create_from_date_string($info['package_time'] . ' hours'));
     $newCustomer = Customer::addCustomer();
     $startTime = $startTime->format('Y-m-d H:i');
     $endTime = $endTime->format('Y-m-d H:i');
     // Create the appointment with this new customer id
     Appointment::addAppointment($newCustomer);
     if ($overlapDays) {
         // Remove hours up to the last hour of the day, then continue to the next day
         // If necessary
         // PSEUDO CODE
         // We will get the last appointment of the day and see if it's smaller than the package time
         // If the last appointment occurs beyond the package duration, we delete like normal
         // If the last appointment occurs before the package duration
         // We subtract the hours we remove from the package duration to get remaining time
         // Then we go to the next day with appointment times and remove enough appointments
         // To make clearance for the package duration.
     } else {
         // Remove all dates conflicting with the appointment duration
         BookingDateTime::timeBetween($startTime, $endTime)->delete();
     }
     return View::make('success');
 }
開發者ID:jacobDaeHyung,項目名稱:booking-app,代碼行數:37,代碼來源:BookingController.php


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