You are here

public function TeamMemberRole::getTeamRoles in Apigee Edge 8

Returns the team roles of the developer within the team.

Return value

\Drupal\apigee_edge_teams\Entity\TeamRoleInterface[] Array of team roles or an empty array if the entity is new and it has not been set yet.

Overrides TeamMemberRoleInterface::getTeamRoles

File

modules/apigee_edge_teams/src/Entity/TeamMemberRole.php, line 127

Class

TeamMemberRole
Defines the team member role entity.

Namespace

Drupal\apigee_edge_teams\Entity

Code

public function getTeamRoles() : array {
  $roles = [];

  /** @var \Drupal\apigee_edge_teams\Entity\TeamMemberRoleInterface $reference */
  foreach ($this
    ->get('roles') as $reference) {

    // The team role has been deleted.
    if ($reference->entity === NULL) {
      continue;
    }
    $roles[$reference->entity
      ->id()] = $reference->entity;
  }
  return $roles;
}