You are here

function og_get_group_type in Organic groups 7.2

Same name and namespace in other branches
  1. 7 og.module \og_get_group_type()

Return the group type (i.e. "group" or "group_content") of an entity.

Parameters

$entity_type: The entity type.

$bundle_name: The bundle name to be checked.

$type: The group usage type. Must be "group" or "group content".

Return value

The group type or an "omitted" if node type doesn't participate in Group.

2 calls to og_get_group_type()
og_is_group_content_type in ./og.module
Return TRUE if the entity type is a "group content" type.
og_is_group_type in ./og.module
Return TRUE if the entity type is a "group" type.

File

./og.module, line 2454
Enable users to create and manage groups with roles and permissions.

Code

function og_get_group_type($entity_type, $bundle_name, $type = 'group') {
  if ($type == 'group') {
    return (bool) field_info_instance($entity_type, OG_GROUP_FIELD, $bundle_name);
  }
  elseif ($type == 'group content') {
    return (bool) og_get_group_audience_fields($entity_type, $bundle_name);
  }
}