You are here

public function OgRoleManager::getRolesByBundle in Organic groups 8

Returns all the roles of a provided group.

Parameters

string $entity_type_id: The entity type ID of the group.

string $bundle: The bundle of the group.

Return value

\Drupal\og\OgRoleInterface[] An array of roles indexed by their IDs.

Overrides OgRoleManagerInterface::getRolesByBundle

File

src/OgRoleManager.php, line 129

Class

OgRoleManager
Defines a manager of an OG role.

Namespace

Drupal\og

Code

public function getRolesByBundle($entity_type_id, $bundle) {
  $properties = [
    'group_type' => $entity_type_id,
    'group_bundle' => $bundle,
  ];
  return $this
    ->ogRoleStorage()
    ->loadByProperties($properties);
}