You are here

public function TeamMembershipManager::addMembers in Apigee Edge 8

Same name in this branch
  1. 8 modules/apigee_edge_teams/src/TeamMembershipManager.php \Drupal\apigee_edge_teams\TeamMembershipManager::addMembers()
  2. 8 modules/apigee_edge_actions/src/TeamMembershipManager.php \Drupal\apigee_edge_actions\TeamMembershipManager::addMembers()

Adds members to a team.

Parameters

string $team: Name of a team.

array $developers: Array of developer email addresses.

Overrides TeamMembershipManagerInterface::addMembers

File

modules/apigee_edge_teams/src/TeamMembershipManager.php, line 120

Class

TeamMembershipManager
Service that makes easier to work with company (team) memberships.

Namespace

Drupal\apigee_edge_teams

Code

public function addMembers(string $team, array $developers) : void {
  $membership = new CompanyMembership(array_map(function ($item) {
    return NULL;
  }, array_flip($developers)));
  $controller = $this->companyMembersControllerFactory
    ->companyMembersController($team);
  $controller
    ->setMembers($membership);
  $this
    ->invalidateCaches($team, $developers);
}