You are here

public function GroupType::getRoleIds in Group 8

Same name and namespace in other branches
  1. 2.0.x src/Entity/GroupType.php \Drupal\group\Entity\GroupType::getRoleIds()

Gets the role IDs.

Parameters

bool $include_internal: (optional) Whether to include internal roles in the result. Defaults to TRUE.

Return value

string[] The ids of the group roles this group type uses.

Overrides GroupTypeInterface::getRoleIds

File

src/Entity/GroupType.php, line 152

Class

GroupType
Defines the Group type configuration entity.

Namespace

Drupal\group\Entity

Code

public function getRoleIds($include_internal = TRUE) {
  $query = $this
    ->entityTypeManager()
    ->getStorage('group_role')
    ->getQuery()
    ->condition('group_type', $this
    ->id());

  // Exclude internal roles if told to.
  if ($include_internal === FALSE) {
    $query
      ->condition('internal', FALSE);
  }
  return $query
    ->execute();
}