本文整理汇总了PHP中Data::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Data::all方法的具体用法?PHP Data::all怎么用?PHP Data::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Data
的用法示例。
在下文中一共展示了Data::all方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
public function indexAction()
{
$user = User::findOrFail(Auth::user()->id);
//die(var_dump($user));
if ($user->name == $this->adminGroup) {
$records = Data::all();
} else {
$records = $user->datas()->get();
}
$data = ["records" => $records, "HeaderTitle" => trans('data.index')];
return View::make($this->routeIndex, $data);
}
示例2: getReport
public function getReport()
{
// $purp = new Purpose();
// $per_page = Config::get('nhc/site.perpage') ;
// $purpose = $purp->getAllPurpose($per_page);
$allDataName = Data::all(array('id', 'data_name'))->toArray();
foreach ($allDataName as $key => $value) {
$arr_data[$key]['id'] = 'data_' . $value['id'];
$arr_data[$key]['name'] = $value['data_name'];
}
$allRoleName = Roles::all(array('id', 'role_name'))->toArray();
foreach ($allRoleName as $key => $value) {
$arr_role[$key]['id'] = 'role_' . $value['id'];
$arr_role[$key]['name'] = $value['role_name'];
}
$supportData = array_merge($arr_role, $arr_data);
return View::make('report.report')->with('listbox', $supportData);
//->with('paginator',$purpose);
}
示例3: listDataFrm
/**
* [listDataFrm show form data and select data run by ajax
* @return [array] [collect of data]
*/
public function listDataFrm()
{
return View::make('rbac.datalist')->with('all_data', Data::all());
}
示例4: privacyDataSave
/**
* [privacyDataSave save method for user privacy
* @param [integer] $agency_id [agency id]
* @param [integer] $user_id [user id]
* @return [none] [redirect to user privacy page]
*/
public function privacyDataSave($agency_id, $user_id)
{
$data = Input::all();
//var_dump($data);exit;
//Get all data type
$data_type = Data::all();
foreach ($data as $key => $value) {
if ($key != "_token") {
list($data_id, $table_info) = explode(":", $key);
$value == 'on' ? $status = true : ($status = false);
// echo $status;
// echo "<br />";
$priv_data['data_id'] = $data_id;
$priv_data['agency_id'] = $agency_id;
$priv_data['status'] = $status;
$privacy_data[] = $priv_data;
}
}
// var_dump($privacy_data);
// exit;
DataPrivacy::where('agency_id', '=', $agency_id)->delete();
DataPrivacy::insert($privacy_data);
return Redirect::to('/privacy/' . $user_id)->with('success', 'Your data privacy saved.');
}
示例5: peerDataFrm
/**
* [peerDataFrm show form peer's data use ajax]
* @return [type] [description]
*/
public function peerDataFrm()
{
return View::make('peer.datalist')->with('all_data', Data::all());
}
示例6: dataPeerPrivacy
/**
* [dataPeerPrivacy return information of agency's privacy]
* @param [integer] $agency_id [agency id]
* @return [type] [description]
*/
public function dataPeerPrivacy($agency_id)
{
$dataprivacy = new DataPrivacy();
//$rs index is agency_id
$rs = $dataprivacy->getDataPrivacy($agency_id);
// var_dump(Data::all()->toArray());
// var_dump($rs);exit;
return View::make('peer.ajax_dataprivacy')->with('agency_dataprivacy', $rs)->with('data_info', Data::all()->toArray());
}
示例7: usageAction
public function usageAction()
{
$roleObj = Roles::all();
$dataObj = Data::all();
return View::make('usage.usage');
}