You are here

public function GroupTypeManager::getAllGroupContentBundlesByEntityType in Organic groups 8

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

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

Parameters

string $entity_type_id: Entity type ID to filter the bundles by.

Return value

string[] An array of group content bundle IDs.

Throws

\InvalidArgumentException Thrown when the passed in entity type ID does not have any group content bundles defined.

Overrides GroupTypeManagerInterface::getAllGroupContentBundlesByEntityType

See also

\Drupal\og\GroupTypeManagerInterface::getGroupRelationMap()

File

src/GroupTypeManager.php, line 218

Class

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

Namespace

Drupal\og

Code

public function getAllGroupContentBundlesByEntityType($entity_type_id) {
  $bundles = $this
    ->getAllGroupContentBundleIds();
  if (!isset($bundles[$entity_type_id])) {
    throw new \InvalidArgumentException("The '{$entity_type_id}' entity type has no group content bundles.");
  }
  return $bundles[$entity_type_id];
}