function og_subgroups_intersect_groups in Subgroups for Organic groups 7.2
Computes the intersection (shared) between two group arrays.
2 calls to og_subgroups_intersect_groups()
- OgSubgroupHelperFunctionUnitTestCase::testOgSubgroupHelperFunctions in ./
og_subgroups.test - Tests drupal_array_diff_assoc_recursive().
- _og_subgroups_check_access in ./
og_subgroups.module - Check access for this group's parents.
File
- ./
og_subgroups.common.inc, line 11 - Common functions used in og_subgroups.
Code
function og_subgroups_intersect_groups($groups, $groups2) {
$return = array();
foreach ($groups as $group_type => $ids) {
if (!empty($groups2[$group_type]) && ($gids = array_intersect($ids, $groups2[$group_type]))) {
$return[$group_type] = $gids;
}
}
return $return;
}