function og_rules_get_managers in Organic groups 7
Same name and namespace in other branches
- 7.2 og.rules.inc \og_rules_get_managers()
Action: Get group managers from a group content.
1 string reference to 'og_rules_get_managers'
- og_rules_action_info in ./
og.rules.inc - Implements hook_rules_action_info().
File
- ./
og.rules.inc, line 260 - Rules integration for the Organic groups module.
Code
function og_rules_get_managers($group_content) {
if (!isset($group_content->og_membership)) {
// Not a group content.
return;
}
$return = array();
$gids = array();
foreach ($group_content->og_membership
->value() as $og_membership) {
$gids[] = $og_membership->gid;
}
if (!$gids) {
return;
}
$groups = og_load_multiple($gids);
foreach ($groups as $group) {
if ($account = $group
->user()) {
$return[] = $account->uid;
}
}
return array(
'group_managers' => $return,
);
}