本文整理匯總了PHP中Groups::getRelationProvider方法的典型用法代碼示例。如果您正苦於以下問題:PHP Groups::getRelationProvider方法的具體用法?PHP Groups::getRelationProvider怎麽用?PHP Groups::getRelationProvider使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Groups
的用法示例。
在下文中一共展示了Groups::getRelationProvider方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: subscriberCounterStat
public function subscriberCounterStat()
{
$count = 0;
$subscriber = Group::where('name', 'LIKE', '%ubscrib%')->first();
if ($subscriber) {
$related = Groups::getRelationProvider()->createModel()->where('group_id', '=', $subscriber->id);
$count = count($related->get());
}
$this->widgetData = array('count' => $count);
$this->setupWidgetLayout(__METHOD__);
}
示例2: deleteBrandRemoval
/**
* Brand Removal
*
* @AclMap(name="user_brand_removal",config={"except":"banned,guest"},insufficient_message="acl.login")
*/
public function deleteBrandRemoval()
{
$user_from_auth = Auth::user();
if (!$user_from_auth) {
App::abort(404);
}
$user = User::find((int) $user_from_auth->id);
if (!$user) {
App::abort(404);
}
$brand_id = Input::get('brand_id');
if (empty($brand_id)) {
return Response::json(array('message' => 'Invalid brand.'));
}
$status = Groups::getRelationProvider()->removeUserFromBrand($user->id, $brand_id);
$user->brandSwitch(0);
return Response::json(array('message' => 'Removed from brand.'));
}