You are here

public function GroupDeleteForm::form in Entity Share 8

Same name and namespace in other branches
  1. 8.3 modules/entity_share_server/src/Form/GroupDeleteForm.php \Drupal\entity_share_server\Form\GroupDeleteForm::form()
  2. 8.2 modules/entity_share_server/src/Form/GroupDeleteForm.php \Drupal\entity_share_server\Form\GroupDeleteForm::form()

Gets the actual form array to be built.

Overrides EntityForm::form

See also

\Drupal\Core\Entity\EntityForm::processForm()

\Drupal\Core\Entity\EntityForm::afterBuild()

File

modules/entity_share_server/src/Form/GroupDeleteForm.php, line 24

Class

GroupDeleteForm
Class GroupDeleteForm.

Namespace

Drupal\entity_share_server\Form

Code

public function form(array $form, FormStateInterface $form_state) {
  $group_id = $this
    ->getgroupId();

  // Check if the group exists.
  if (!$this
    ->groupIdExists()) {
    drupal_set_message($this
      ->t('There is no group with the ID @id in this channel', [
      '@id' => $group_id,
    ]), 'error');
    return [];
  }
  $form = parent::form($form, $form_state);
  $form['description'] = [
    '#markup' => $this
      ->t('This action cannot be undone.'),
  ];
  return $form;
}