You are here

function og_get_all_group_content_entity in Organic groups 7

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

Return all the enteties 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 enteties are defined as group content.

5 calls to og_get_all_group_content_entity()
og_entity_property_info in ./og.module
Implements hook_entity_property_info().
og_group in ./og.module
Set an association (e.g. subscribe) an entity to a group.
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/og.views.inc
Implements hook_views_data_alter().

File

./og.module, line 2109
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) {
    if (!empty($entity_value['fieldable'])) {
      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;
}