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


PHP Task::find方法代碼示例

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


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

示例1: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $task = Task::find($id);
     if ($task) {
         $task->delete();
     }
 }
開發者ID:elagith,項目名稱:learningMaterial,代碼行數:13,代碼來源:TasksController.php

示例2: completeTask

 public function completeTask()
 {
     $id = $_GET['id'];
     $Task = Task::find($id);
     $Task->complete();
     return Redirect::back();
 }
開發者ID:peterjewicz,項目名稱:client_tracker,代碼行數:7,代碼來源:taskController.php

示例3: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $tasks = Task::find($id);
     $tasks->delete();
     // redirect
     return Redirect::route('tasks.index');
 }
開發者ID:Ekra,項目名稱:todo-laravel,代碼行數:13,代碼來源:TasksController.php

示例4: edit

 public static function edit($id)
 {
     self::check_logged_in();
     $task = Task::find($id);
     $task->projectids = explode(",", $task->projectids);
     $projects = Project::all();
     View::make('task/edit.html', array('attributes' => $task, 'projects' => $projects));
 }
開發者ID:rubinju,項目名稱:Todolist,代碼行數:8,代碼來源:tasks_controller.php

示例5: destroy

 public function destroy($id_task)
 {
     $task = Task::find($id_task);
     if ($task) {
         $task->delete();
     }
     return Redirect::route('index_admin');
 }
開發者ID:Metrakit,項目名稱:dynamix,代碼行數:8,代碼來源:AdminTasksController.php

示例6: update

 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $input = Input::json();
     $task = Task::find($id);
     $task->title = $input->get('title');
     $task->completed = $input->get('completed');
     $task->save();
 }
開發者ID:elagith,項目名稱:learningMaterial,代碼行數:14,代碼來源:TasksController.php

示例7: cleanDeadTasks

 /**
  * Check dead tasks for current worker, and break it if dead.
  */
 public function cleanDeadTasks()
 {
     $deadTasks = Task::find()->andWhere(['status' => 'in-progress'])->andWhere('dead_time > NOW()')->all();
     foreach ($deadTasks as $deadTask) {
         $deadTask->status = 'aborted';
         $deadTask->save();
     }
     return true;
 }
開發者ID:voodoo-mobile,項目名稱:yii2-bg-tasks,代碼行數:12,代碼來源:FacebookWorker.php

示例8: update

 /**
  * Update the specified resource in storage.
  * PUT /tasks/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $task = Task::where('id', $id)->update(Input::all());
     if ($task) {
         $data = Task::find($id);
         return ['status' => true, 'data' => $data];
     } else {
         return ['status' => false];
     }
 }
開發者ID:sahilkathpal,項目名稱:hackcoin,代碼行數:17,代碼來源:TasksController.php

示例9: getEmailtaskopened

 public function getEmailtaskopened($id = false)
 {
     if (!$id) {
         return App::abort(404);
     }
     $task = Task::find($id);
     if (!$task) {
         return App::abort(404);
     }
     Taskemails::taskOpened($task);
 }
開發者ID:nix222,項目名稱:crm-system,代碼行數:11,代碼來源:TestController.php

示例10: test_find

 function test_find()
 {
     $description = "Wash the dog";
     $description2 = "Water the lawn";
     $test_Task = new Task($description);
     $test_Task->save();
     $test_Task2 = new Task($description2);
     $test_Task2->save();
     $id = $test_Task->getId();
     $result = Task::find($id);
     $this->assertEquals($test_Task, $result);
 }
開發者ID:CaseyH33,項目名稱:ToD,代碼行數:12,代碼來源:TaskTest.php

示例11: complete

 public function complete($id)
 {
     $date = time();
     $task = Task::find($id);
     $task->done_at = $date;
     $task->isDone = 1;
     $task->save();
     $tache = Task::where('id', '=', $id)->get();
     $titre = $tache[0]->title;
     Session::flash('completed', "La tâche <em>{$titre}</em> a bien été complété.");
     return Redirect::to(URL::previous());
 }
開發者ID:Yoan-Philippe,項目名稱:tasks,代碼行數:12,代碼來源:HomeController.php

示例12: updateOrder

 public function updateOrder()
 {
     Log::debug(__METHOD__);
     if (Input::get('id') == null) {
         return 'update_order noop';
     }
     // 並び順の変更はタイムスタンプを更新したくない
     foreach (Input::get('id') as $i => $task_id) {
         $target_task = Task::find($task_id);
         $target_task->timestamps = false;
         $target_task->order_no = $i;
         $target_task->save();
         $target_task->timestamps = true;
     }
     return 'update_order ok';
 }
開發者ID:neilmillard,項目名稱:kanbanlist,代碼行數:16,代碼來源:TasksController.php

示例13: edit

 public function edit(Request $request, $id)
 {
     //$tache=new Task();
     //$tache=Task::all()->where('user_id',$id);
     $user = Auth::user()->id;
     $tache = Task::where('id', $id)->where('user_id', $user)->get();
     if (!$tache->isEmpty()) {
         //Ecriture dans la DB de la forme Tache
         $input = $request->all();
         $tache = new Task();
         $tache = Task::find($id);
         $tache->user_id = $user;
         $tache->name = $request->input('tache');
         $tache->descriptionTache = $request->input('description');
         $tache->update();
         return redirect('/list')->with('flash_message', 'Modifié avec succés');
     } else {
         return redirect('/list')->with('flash_message_bad', "Erreur vous avez modifié l'id");
     }
 }
開發者ID:viccamanuel,項目名稱:projet_trica,代碼行數:20,代碼來源:taskController.php

示例14: workflowSubmit

 public function workflowSubmit()
 {
     $designation = e(Input::get('designa'));
     if ($designation == 0) {
         $des_name = "";
     } else {
         $des = Designation::find($designation);
         $des_name = e($des->designation);
     }
     $id = Input::get('task_id');
     $assignd = Task::find($id);
     $assignd->designation_id = Input::get('designa');
     $assignd->save();
     if ($designation == 0) {
         $data = array("html" => "<div id='insert_{$id}' class='mode1'> None  </div> <input type='hidden' id='hide_currentDesignation' class='hide_currentDesignation' value='0' > ");
     } else {
         $data = array("html" => "<div id='insert_{$id}' class='mode1'> {$des_name}  </div> <input type='hidden' id='hide_currentDesignation' class='hide_currentDesignation' value='{$assignd->designation_id}' > ");
     }
     return Response::json($data);
 }
開發者ID:iHunt101,項目名稱:procurementTrackingSystem,代碼行數:20,代碼來源:AjaxController.php

示例15: getEntries

 public function getEntries($day, $userId)
 {
     try {
         //Get the entries
         $tempEntries = Timesheet::where('date', $day)->where('user_id', $userId)->get()->toArray();
         $finalEntries = array();
         //Get Task Name
         foreach ($tempEntries as $entry) {
             if ($entry['task_id'] != null) {
                 $entry['task'] = \Task::find($entry['task_id'])->toArray();
             } else {
                 $entry['task'] = null;
             }
             $finalEntries[] = $entry;
         }
         return $finalEntries;
     } catch (\Exception $e) {
         \Log::error('Something Went Wrong in Timesheet Repository - getEntries():' . $e->getMessage());
         throw new SomeThingWentWrongException();
     }
 }
開發者ID:ymnl007,項目名稱:92five,代碼行數:21,代碼來源:TimesheetRepository.php


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