You are here

function og_subgroups_children_load in Subgroups for Organic groups 7.2

Gets the children of the given group including current group.

Parameters

$group_type: The type of entity.

$group_id: The id of the entity.

$filter: Boolean value for whether to return only groups that allow for inheritance.

$fetch_all: Fetch all including grandchildren and below.

$include_current: Include the group that was given as paramaters.

$reset: Reset the cache for this entity.

1 call to og_subgroups_children_load()
OgSubgroupsAccessFromDescendanceTestCase::testOgSubgroupsPermissions in ./og_subgroups.test
Use cases:

File

./og_subgroups.common.inc, line 439
Common functions used in og_subgroups.

Code

function og_subgroups_children_load($group_type, $group_id, $filter = TRUE, $fetch_all = TRUE, $include_current = FALSE, $reset = FALSE) {
  $groups_all =& drupal_static(__FUNCTION__, array());
  $cid = $group_type . '__' . $group_id . '__' . ($filter ? '1' : '0') . '__' . ($fetch_all ? '1' : '0') . '__' . ($include_current ? '1' : '0');
  if (!isset($groups_all[$cid]) || $reset) {
    $groups_all[$cid] = og_subgroups_children_load_multiple(array(
      $group_type => array(
        $group_id,
      ),
    ), $filter, $fetch_all, $include_current, $reset);
  }
  return $groups_all[$cid];
}