本文整理汇总了PHP中Zone::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Zone::all方法的具体用法?PHP Zone::all怎么用?PHP Zone::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zone
的用法示例。
在下文中一共展示了Zone::all方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index($id)
{
$site = Site::find($id);
$zones = Zone::all();
$data = array('page' => 'sites', 'tab' => 'manage', 'site' => $site, 'zones' => $zones);
return View::make('site_zone.index', $data);
}
示例2: zones
public function zones()
{
$zones = Zone::all()->toJson();
return $zones;
// Response::json($zones);
}
示例3: updatePermissions
public function updatePermissions()
{
$user = User::find(Input::get('rfid'));
$sites = Site::all();
foreach ($sites as $key => $value) {
$selected_site = Input::get('selected_site_' . $value->id);
if ($selected_site) {
$site = Site::find($selected_site);
if ($site->GivesAccessToUser($user->rfid) == 'Denied') {
DB::table('site_user')->insert(array('site_id' => $value->id, 'user_id' => $user->rfid));
} else {
DB::table('site_user')->where('user_id', '=', $user->rfid)->where('site_id', '=', $value->id)->delete();
}
}
}
$zones = Zone::all();
foreach ($zones as $key => $value) {
$selected_zone = Input::get('selected_zone_' . $value->id);
if ($selected_zone) {
if ($value->GivesAccessToUser($user->rfid) == 'Denied') {
DB::table('user_zone')->insert(array('zone_id' => $value->id, 'user_id' => $user->rfid));
foreach ($sites as $site) {
if ($value->ContainsSite($site->id)) {
DB::table('site_user')->insert(array('site_id' => $site->id, 'user_id' => $user->rfid));
}
}
} else {
DB::table('user_zone')->where('user_id', '=', $user->rfid)->where('zone_id', '=', $value->id)->delete();
foreach ($sites as $site) {
if ($value->ContainsSite($site->id)) {
DB::table('site_user')->where('user_id', '=', $user->rfid)->where('site_id', '=', $site->id)->delete();
}
}
}
}
}
return Redirect::to('user/' . $user->id);
}