EmailDeleteForm.php in Courier 8
Same filename and directory in other branches
Contains \Drupal\courier\Form\EmailDeleteForm.
Namespace
Drupal\courier\FormFile
src/Form/EmailDeleteForm.phpView source
<?php
/**
* @file
* Contains \Drupal\courier\Form\EmailDeleteForm.
*/
namespace Drupal\courier\Form;
use Drupal\Core\Entity\ContentEntityConfirmFormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Form for deleting an email.
*/
class EmailDeleteForm extends ContentEntityConfirmFormBase {
/**
* {@inheritdoc}
*/
public function getQuestion() {
return t('Are you sure you want to delete this email?');
}
/**
* {@inheritdoc}
*/
public function getCancelUrl() {
return $this->entity
->urlInfo();
}
/**
* {@inheritdoc}
*/
public function getConfirmText() {
return t('Delete');
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$email = $this->entity;
$email
->delete();
drupal_set_message(t('Email deleted.'));
}
}
Classes
Name | Description |
---|---|
EmailDeleteForm | Form for deleting an email. |