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


PHP Control::find方法代碼示例

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


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

示例1: update

 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($controlTestId)
 {
     $control = Control::find($controlTestId);
     $controlTest = ControlTest::find($controlTestId);
     $controlTest->entered_by = Auth::user()->id;
     $controlTest->control_id = $controlTest->control->id;
     $controlTest->save();
     foreach ($controlTest->control->controlMeasures as $controlMeasure) {
         $controlResult = ControlMeasureResult::where('control_measure_id', $controlMeasure->id)->where('control_test_id', $controlTest->id)->first();
         $controlResult->results = Input::get('m_' . $controlMeasure->id);
         $controlResult->control_measure_id = $controlMeasure->id;
         $controlResult->control_test_id = $controlTestId;
         $controlResult->save();
     }
     return Redirect::route('control.resultsIndex')->with('message', trans('messages.success-updating-control-result'));
 }
開發者ID:BaobabHealthTrust,項目名稱:iBLIS,代碼行數:22,代碼來源:ControlResultsController.php

示例2: qualityControlResults

 /**
  * Returns qc results for a specific control page
  *
  * @param Input - controlId, date range
  * @return view
  */
 public function qualityControlResults()
 {
     $rules = array('start_date' => 'date|required', 'end_date' => 'date|required', 'control' => 'required');
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     } else {
         $controlId = Input::get('control');
         $endDatePlusOne = date_add(new DateTime(Input::get('end_date')), date_interval_create_from_date_string('1 day'));
         $dates = array(Input::get('start_date'), $endDatePlusOne);
         $control = Control::find($controlId);
         $controlTests = ControlTest::where('control_id', '=', $controlId)->whereBetween('created_at', $dates)->get();
         $leveyJennings = $this->leveyJennings($control, $dates);
         return View::make('reports.qualitycontrol.results')->with('control', $control)->with('controlTests', $controlTests)->with('leveyJennings', $leveyJennings)->withInput(Input::all());
     }
 }
開發者ID:BaobabHealthTrust,項目名稱:iBLIS,代碼行數:22,代碼來源:ReportController.php

示例3: testDestroy

 /**
  * Testing Control destroy funciton
  */
 public function testDestroy()
 {
     $this->action('DELETE', 'ControlController@destroy', array(1));
     $control = Control::find(1);
     $this->assertNull($control);
 }
開發者ID:BaobabHealthTrust,項目名稱:iBLIS,代碼行數:9,代碼來源:ControlControllerTest.php


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