You are here

protected function TeamMembersFormBase::getRoleOptions in Apigee Edge 8

Returns an array of team role options keyed by team role id.

Return value

array Role options.

2 calls to TeamMembersFormBase::getRoleOptions()
AddTeamMembersForm::buildForm in modules/apigee_edge_teams/src/Form/AddTeamMembersForm.php
Form constructor.
EditTeamMemberForm::buildForm in modules/apigee_edge_teams/src/Form/EditTeamMemberForm.php
Form constructor.

File

modules/apigee_edge_teams/src/Form/TeamMembersFormBase.php, line 80

Class

TeamMembersFormBase
Base team members form.

Namespace

Drupal\apigee_edge_teams\Form

Code

protected function getRoleOptions() {
  $role_options = array_reduce($this->teamRoleStorage
    ->loadMultiple(), function (array $carry, TeamRoleInterface $role) {
    $carry[$role
      ->id()] = $role
      ->label();
    return $carry;
  }, []);
  return $role_options;
}