You are here

public function GroupTypeManager::getAllGroupContentBundleIds in Organic groups 8

Returns a list of all group content bundles IDs keyed by entity type.

This will return a simple list of group content bundles IDs. If you need information about the relations between groups and group content bundles then use getGroupRelationMap() instead.

Return value

string[][] An associative array of group content bundle IDs, keyed by entity type ID.

Overrides GroupTypeManagerInterface::getAllGroupContentBundleIds

See also

\Drupal\og\GroupTypeManagerInterface::getGroupRelationMap()

1 call to GroupTypeManager::getAllGroupContentBundleIds()
GroupTypeManager::getAllGroupContentBundlesByEntityType in src/GroupTypeManager.php
Returns a list of all group content bundles filtered by entity type.

File

src/GroupTypeManager.php, line 203

Class

GroupTypeManager
A manager to keep track of which entity type/bundles are OG group enabled.

Namespace

Drupal\og

Code

public function getAllGroupContentBundleIds() {
  $bundles = [];
  foreach ($this
    ->getGroupRelationMap() as $group_bundle_ids) {
    foreach ($group_bundle_ids as $group_content_entity_type_ids) {
      foreach ($group_content_entity_type_ids as $group_content_entity_type_id => $group_content_bundle_ids) {
        $bundles[$group_content_entity_type_id] = array_merge(isset($bundles[$group_content_entity_type_id]) ? $bundles[$group_content_entity_type_id] : [], $group_content_bundle_ids);
      }
    }
  }
  return $bundles;
}