You are here

public static function OgRole::loadByGroupType in Organic groups 8

Returns the roles that are associated with the given group type and bundle.

Parameters

string $group_entity_type_id: The group entity type ID.

string $group_bundle_id_id: The group bundle ID.

Return value

\Drupal\og\OgRoleInterface[] The roles.

Overrides OgRoleInterface::loadByGroupType

1 call to OgRole::loadByGroupType()
OgAddMultipleRolesForm::buildForm in src/Form/OgAddMultipleRolesForm.php
Form constructor.

File

src/Entity/OgRole.php, line 175

Class

OgRole
Defines the OG user role entity class.

Namespace

Drupal\og\Entity

Code

public static function loadByGroupType($group_entity_type_id, $group_bundle_id) {
  $properties = [
    'group_type' => $group_entity_type_id,
    'group_bundle' => $group_bundle_id,
  ];
  return \Drupal::entityTypeManager()
    ->getStorage('og_role')
    ->loadByProperties($properties);
}