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


PHP Data::find方法代码示例

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


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

示例1: queryDataAction

 /**
  * [queryDataAction query data by use ajax get data follow flag]
  * @param  [integer] $dataid [data id]
  * @param  [integer] $cond_id [condtion id]
  * @param  [string] $flag   [to specific data is own agency or all agency]
  * @param  [integer] $agencyid [agenc id]
  * @return [array]         [collection of data]
  */
 public function queryDataAction($dataid, $cond_id, $flag, $agencyid = "")
 {
     $data_name = Data::find($dataid)->data_name;
     $qData = new QueryData();
     $rsData = $qData->queryDataNHC($this->policy_id, $dataid, $cond_id, $flag, $agencyid);
     if ($rsData) {
         if ($dataid == 11) {
             list($tb_name, $field, $datefield, $tele_id) = explode("-", $rsData['info_querydata']->table_name);
         } else {
             list($tb_name, $field, $datefield) = explode("-", $rsData['info_querydata']->table_name);
         }
         if ($dataid == 6) {
             $teleid = 'dam_id';
         } else {
             $teleid = 'tele_station_id';
         }
     } else {
         $rsData['data'] = null;
         $data_name = null;
         $datefield = null;
         $field = null;
         $teleid = null;
     }
     // var_dump($rsData);exit;
     // return View::make('querydata.ajax_test')
     // 			->with('paginator',$rsData['data']);
     return View::make('querydata.ajax_data')->with('paginator', $rsData['data'])->with('data_name', $data_name)->with('field_date', $datefield)->with('field_value', $field)->with('teleid', $teleid);
 }
开发者ID:nattaphat,项目名称:cuse2,代码行数:36,代码来源:QueryDataController.php

示例2: editedDataAction

 /**
  * [editedDataAction description]
  * @param  [type] $id [description]
  * @return [type]     [description]
  */
 public function editedDataAction($id)
 {
     $data = Input::all();
     $rules = array('dataname' => array('required'));
     // Build the custom messages array.
     $messages = array('dataname.required' => 'กรุณาระบุชื่อข้อมูล');
     // Create a new validator instance.
     $validator = Validator::make($data, $rules, $messages);
     if ($validator->passes()) {
         $data_content = trim($data['dataname']);
         $data_tablename = trim($data['table_name']);
         $data_obj = Data::find($id);
         $rs_check = $data_obj->checkData($data_content, $data_tablename);
         if ($rs_check) {
             $data_obj->data_name = $data_content;
             $data_obj->table_name = $data_tablename;
             $data_obj->save();
             return Redirect::to('data')->with('success', 'แก้ไขสำเร็จ');
         } else {
             return Redirect::to('data-edit/' . $id)->with('warning', 'มีชื่อข้อมูลอยู่ในระบบแล้ว');
         }
     } else {
         // $errors = $validator->messages();
         return Redirect::to('data-edit/' . $id)->withErrors($validator);
     }
 }
开发者ID:nattaphat,项目名称:cuse2,代码行数:31,代码来源:DataController.php

示例3: dashboard

 public function dashboard()
 {
     if (Auth::is_valid()) {
         $data = new Data();
         $carpeta = new Carpeta();
         $this->data = $data->find();
         $this->carpetas = $carpeta->get_nombre_carpetas_by_user_id(Auth::get("id"));
         $this->obj_carpeta_data = new CarpetaData();
     }
 }
开发者ID:jaimeirazabal1,项目名称:intercambio_de_perfiles,代码行数:10,代码来源:index_controller.php

示例4: disconnect

 /**
  * disconnect
  * --------------------------------------------------
  * Disconnecting the user from braintree.
  * @throws BraintreeNotConnected
  * --------------------------------------------------
  */
 public function disconnect()
 {
     /* Check valid connection */
     if (!$this->user->isBraintreeConnected()) {
         throw new BraintreeNotConnected();
     }
     $this->user->connections()->where('service', 'braintree')->delete();
     /* Deleting all widgets, plans, subscribtions */
     foreach ($this->user->widgets() as $widget) {
         if ($widget->descriptor->category == 'braintree') {
             /* Saving data while it is accessible. */
             $dataID = 0;
             if (!is_null($widget->data)) {
                 $dataID = $widget->data->id;
             }
             $widget->delete();
             /* Deleting data if it was present. */
             if ($dataID > 0) {
                 Data::find($dataID)->delete();
             }
         }
     }
     /* Deleting all plans. */
     foreach ($this->user->braintreePlans as $braintreePlan) {
         BraintreeSubscription::where('plan_id', $braintreePlan->id)->delete();
         $braintreePlan->delete();
     }
 }
开发者ID:neraunzaran,项目名称:fruit-dashboard,代码行数:35,代码来源:BraintreeConnector.php


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