3 namespace Drupal\fontyourface\Form;
5 use Drupal\Core\Entity\EntityConfirmFormBase;
6 use Drupal\Core\Form\FormStateInterface;
10 * Builds the form to delete Font display entities.
12 class FontDisplayDeleteForm extends EntityConfirmFormBase {
17 public function getQuestion() {
18 return $this->t('Are you sure you want to delete %name?', ['%name' => $this->entity->label()]);
24 public function getCancelUrl() {
25 return new Url('entity.font_display.collection');
31 public function getConfirmText() {
32 return $this->t('Delete');
38 public function submitForm(array &$form, FormStateInterface $form_state) {
39 $this->entity->delete();
42 $this->t('content @type: deleted @label.',
44 '@type' => $this->entity->bundle(),
45 '@label' => $this->entity->label(),
50 drupal_flush_all_caches();
51 $form_state->setRedirectUrl($this->getCancelUrl());