当前位置: 首页>>代码示例>>PHP>>正文


PHP Helper::incrementDateByTimezone方法代码示例

本文整理汇总了PHP中Library\Utility\Helper::incrementDateByTimezone方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper::incrementDateByTimezone方法的具体用法?PHP Helper::incrementDateByTimezone怎么用?PHP Helper::incrementDateByTimezone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Library\Utility\Helper的用法示例。


在下文中一共展示了Helper::incrementDateByTimezone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getIncrementedDateCity

 /**
  * @param $cityId
  * @param $hours
  * @return bool|string
  */
 public function getIncrementedDateCity($cityId, $hours)
 {
     $cityDao = new \DDD\Dao\Geolocation\Cities($this->getServiceLocator(), 'ArrayObject');
     $city = $cityDao->fetchOne(['id' => $cityId], ['timezone']);
     if ($city && $city['timezone']) {
         return Helper::incrementDateByTimezone($city['timezone'], $hours, 'Y-m-d H:i:s');
     }
     return date('Y-m-d H:i:s');
 }
开发者ID:arbi,项目名称:MyCode,代码行数:14,代码来源:Location.php

示例2: ajaxReportIncidentAction

 public function ajaxReportIncidentAction()
 {
     /**
      * @var \DDD\Dao\Booking\Booking $reservationDao
      * @var \DDD\Service\Task $taskService
      */
     $user = $this->getServiceLocator()->get('library_backoffice_auth');
     $taskService = $this->getServiceLocator()->get('service_task');
     $request = $this->getRequest();
     $result = ['status' => 'success', 'msg' => 'Incident report has been created.', 'title' => '', 'taskId' => 0];
     $taskId = (int) $request->getPost('task_id', 0);
     try {
         if ($request->isXmlHttpRequest() && $taskId) {
             $task = $taskService->getTaskDao()->getTaskById($taskId);
             $apartmentId = $task->getProperty_id();
             $buildingId = $task->getBuildingId();
             $resId = $task->getResId();
             $timezone = $task->getTimezone();
             $currentDateCity = Helper::getCurrenctDateByTimezone($timezone, 'Y-m-d H:i:s');
             $ninetySixHoursLaterDateCity = Helper::incrementDateByTimezone($timezone, 96, 'Y-m-d H:i:s');
             $userId = $user->getIdentity()->id;
             $creator = $user->getIdentity()->id;
             switch ((int) $request->getPost('incident_type', 0)) {
                 case HouseKeeping::INCIDENT_REPORT_EVIDENCE_OF_SMOKING:
                     $damageType = 'There was evidence of smoking';
                     break;
                 case HouseKeeping::INCIDENT_REPORT_KEYS_WERE_NOT_RETURNED:
                     $damageType = 'The keys were not returned';
                     break;
                 case HouseKeeping::INCIDENT_REPORT_DIRTY_HOUSE:
                     $damageType = 'The house was left in a unusually dirty condition';
                     break;
                 case HouseKeeping::INCIDENT_REPORT_BROKEN_FURNITURE:
                     $damageType = 'There was broken furniture';
                     break;
                 case HouseKeeping::INCIDENT_REPORT_OTHER:
                     $damageType = $request->getPost('description', 'Incident Report');
                     break;
             }
             $title = $damageType;
             $description = '';
             $incidentTaskId = $taskService->createReportIncidentTask($resId, $apartmentId, $buildingId, $currentDateCity, $ninetySixHoursLaterDateCity, $title, $creator, $description, $userId, $taskId);
             $result['title'] = $title;
             $result['taskId'] = $incidentTaskId;
         }
     } catch (\Exception $e) {
         $result['status'] = 'error';
         $result['msg'] = TextConstants::SERVER_ERROR;
     }
     return new JsonModel($result);
 }
开发者ID:arbi,项目名称:MyCode,代码行数:51,代码来源:HousekeepingTasksController.php


注:本文中的Library\Utility\Helper::incrementDateByTimezone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。