本文整理汇总了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.'));
}