You are here

function og_get_all_group_content_entity in Organic groups 7.2

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

Return all the entities that are a group content.

Return value

Array keyed with the entity type machine name and the entity human readable name as the value, or an empty array if no entities are defined as group content.

3 calls to og_get_all_group_content_entity()
og_rules_action_info in ./og.rules.inc
Implements hook_rules_action_info().
og_rules_condition_info in ./og.rules.inc
Implements hook_rules_condition_info().
og_views_data_alter in includes/views/og.views.inc
Implements hook_views_data_alter().

File

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

Code

function og_get_all_group_content_entity() {
  $return = array();
  foreach (entity_get_info() as $entity_type => $entity_value) {
    foreach ($entity_value['bundles'] as $bundle => $bundle_value) {
      if (og_is_group_content_type($entity_type, $bundle)) {
        $return[$entity_type] = check_plain($entity_value['label']);

        // At least one bundle of the entity can be a group, so break.
        break;
      }
    }
  }
  return $return;
}