当前位置: 首页>>代码示例>>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;未经允许,请勿转载。