You are here

protected function TeamAppFormTrait::getTeamName in Apigee Edge 8

Gets the name of the team from the form.

Parameters

array $form: Form render array.

\Drupal\Core\Form\FormStateInterface $form_state: Form state object.

Return value

string Name (id) of the team.

2 calls to TeamAppFormTrait::getTeamName()
TeamAppFormTrait::apiProductList in modules/apigee_edge_teams/src/Entity/Form/TeamAppFormTrait.php
TeamAppFormTrait::nonMemberApiProductAccessWarningElement in modules/apigee_edge_teams/src/Entity/Form/TeamAppFormTrait.php
Renders a render element with a warning for non-members.

File

modules/apigee_edge_teams/src/Entity/Form/TeamAppFormTrait.php, line 239

Class

TeamAppFormTrait
Helper trait that contains team app (create/edit) form specific tweaks.

Namespace

Drupal\apigee_edge_teams\Entity\Form

Code

protected function getTeamName(array &$form, FormStateInterface $form_state) : string {
  $team_name = $form_state
    ->getValue('owner') ?? $form['owner']['#value'] ?? $form['owner']['#default_value'];
  return $team_name;
}