You are here

public function TeamInvitationFormBase::buildForm in Apigee Edge 8

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides ContentEntityConfirmFormBase::buildForm

File

modules/apigee_edge_teams/src/Entity/Form/TeamInvitationFormBase.php, line 70

Class

TeamInvitationFormBase
Provides a base class for updating status for a team_invitation.

Namespace

Drupal\apigee_edge_teams\Entity\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, TeamInterface $team = NULL) {
  $this->team = $team;
  if ($this->handleExpired && $this->entity
    ->isExpired()) {
    return [
      '#theme' => 'status_messages',
      '#message_list' => [
        'warning' => [
          $this
            ->t('This invitation to join %team @team has expired. Please request a new one.', [
            '%team' => $this->team
              ->label(),
            '@team' => mb_strtolower($this->entity
              ->getTeam()
              ->getEntityType()
              ->getSingularLabel()),
          ]),
        ],
      ],
    ];
  }
  return parent::buildForm($form, $form_state);
}