public function SearchDeleteForm::form in Entity Share 8.3
Same name and namespace in other branches
- 8.2 modules/entity_share_server/src/Form/SearchDeleteForm.php \Drupal\entity_share_server\Form\SearchDeleteForm::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/ SearchDeleteForm.php, line 26
Class
- SearchDeleteForm
- Form to delete a search on a channel.
Namespace
Drupal\entity_share_server\FormCode
public function form(array $form, FormStateInterface $form_state) {
$search_id = $this
->getsearchId();
// Check if the search exists.
if (!$this
->searchIdExists()) {
$this
->messenger()
->addError($this
->t('There is no search with the ID @id in this channel', [
'@id' => $search_id,
]));
return [];
}
$form = parent::form($form, $form_state);
$form['description'] = [
'#markup' => $this
->t('This action cannot be undone.'),
];
return $form;
}