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


PHP Schedule::find_by_id方法代码示例

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


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

示例1: getSchedule

 public function getSchedule($scheduleId)
 {
     $schedule = Schedule::find_by_id($scheduleId);
     if (!$schedule instanceof Schedule) {
         throw new Exception('Invalid schedule: ' . $scheduleId);
     }
     return $schedule;
 }
开发者ID:realskudd,项目名称:breakfast,代码行数:8,代码来源:Rotation.class.php

示例2: getTaskById

 /**
  * Add tastsupport find task
  */
 public function getTaskById($id)
 {
     return Schedule::find_by_id($id);
 }
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:7,代码来源:support_model.php

示例3: getCloseSchedule

 public function getCloseSchedule($id)
 {
     $schedule = Schedule::find_by_id($id);
     //var_dump($_POST['status']);
     //Change in schedule should result in change
     //in ticket and activation call status
     /*
      * checks if  $activityShed is a ticket
      * if not then it is an activation
      * call change the status corresponding to
      * schedule status for each condition
      * */
     if ($_REQUEST['status'] == "Open") {
         // Condition to check if schedule is Open
         $schedule->status = "Open";
         $activityShed = Ticket::find_by_id($schedule->ticket_id);
         if ($activityShed) {
             $activityShed->status = 'Open';
             $activityShed->datemodified = date("Y-m-d H:i:s");
             $activityShed->update();
         } else {
             $activityShed = Activation::find_by_id($schedule->ticket_id);
             if ($activityShed) {
                 $activityShed->status = "Open";
                 $activityShed->created_at = date("Y-m-d H:i:s");
                 $activityShed->update();
             }
         }
         $schedule->update();
         return true;
     } elseif ($_REQUEST['status'] == "Closed") {
         // Condition to check if schedule is closed
         $schedule->status = "Closed";
         $activityShed = Ticket::find_by_id($schedule->ticket_id);
         if ($activityShed) {
             $activityShed->status = 'Closed';
             $activityShed->datemodified = date("Y-m-d H:i:s");
             $activityShed->update();
         } else {
             $activityShed = Activation::find_by_id($schedule->ticket_id);
             if ($activityShed) {
                 $activityShed->status = "Closed";
                 $activityShed->created_at = date("Y-m-d H:i:s");
                 $activityShed->update();
             }
         }
         $schedule->update();
         return true;
     } elseif ($_REQUEST['status'] == "In Progress") {
         // Condition to check if schedule is in progress
         $schedule->status = "In Progress";
         $activityShed = Ticket::find_by_id($schedule->ticket_id);
         if ($activityShed) {
             $activityShed->status = 'Admin Reply';
             // admin reply stands for response for administrator for response to ticket or engineer assigned
             $activityShed->datemodified = date("Y-m-d H:i:s");
         } else {
             $activityShed = Activation::find_by_id($schedule->ticket_id);
             if ($activityShed) {
                 $activityShed->status = "In Progress";
                 $activityShed->created_at = date("Y-m-d H:i:s");
                 $activityShed->update();
             }
         }
         $schedule->update();
         return true;
     } else {
         return false;
     }
     //echo $schedule->update();
 }
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:71,代码来源:support_model.php

示例4: acceptTask

 public function acceptTask()
 {
     global $session;
     $newWorkSheet = new Worksheet();
     $ticket = Schedule::find_by_id($_POST['taskid']);
     if (isset($_POST['taskid'])) {
         $newWorkSheet->cse_emp_id = $_SESSION['emp_ident'];
         $newWorkSheet->formid = $_POST['taskid'];
         $newWorkSheet->prod_id = $ticket->prod_id;
         $newWorkSheet->client_id = $ticket->client_id;
         //$newWorkSheet->contact_person   =   $ticket->contact_name;
         $newWorkSheet->problem = $ticket->issue;
         $newWorkSheet->sheet_date = date("Y:m:d H:i:s");
         $newWorkSheet->datecreated = date("Y:m:d H:i:s");
         $newWorkSheet->status = "Open";
         $ticket->status = "In Progress";
         $ticket->datemodified = date("Y:m:d H:i:s");
         if ($newWorkSheet->create()) {
             $ticket->update();
             return 1;
         } else {
             return 2;
         }
     } else {
         return 3;
     }
 }
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:27,代码来源:itdepartment_model.php


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