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