1 field_group.module field_group_info_groups($entity_type = NULL, $bundle = NULL, $view_mode = NULL, $reset = FALSE)
1 field_group.api.php field_group_info_groups($entity_type = NULL, $bundle = NULL, $view_mode = NULL, $reset = FALSE)

Get all groups that match.

Parameters

string $entity_type: The name of the entity type.

string $bundle: The name of the bundle.

string $view_mode: The view mode.

bool $reset: Whether to reset the cache or not.

Return value

array: Array of group objects.

File

core/modules/field_group/field_group.module, line 737
Field Group module.

Code

function field_group_info_groups($entity_type = NULL, $bundle = NULL, $view_mode = NULL, $reset = FALSE) {
  static $groups = FALSE;

  if (!$groups || $reset) {
    $groups = field_group_read_groups();
  }

  if (!isset($entity_type)) {
    return $groups;
  }
  elseif (!isset($bundle) && isset($groups[$entity_type])) {
    return $groups[$entity_type];
  }
  elseif (!isset($view_mode) && isset($groups[$entity_type][$bundle])) {
    return $groups[$entity_type][$bundle];
  }
  elseif (isset($groups[$entity_type][$bundle][$view_mode])) {
    return $groups[$entity_type][$bundle][$view_mode];
  }
  return array();
}