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