本文整理匯總了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);
}