You are here

MeetingResultDeleteForm.php in Opigno Moxtra 8

Same filename and directory in other branches
  1. 3.x src/Form/MeetingResultDeleteForm.php

File

src/Form/MeetingResultDeleteForm.php
View source
<?php

namespace Drupal\opigno_moxtra\Form;

use Drupal\Core\Entity\ContentEntityConfirmFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;

/**
 * Provides a form for deleting a opigno_moxtra_meeting_result entity.
 */
class MeetingResultDeleteForm extends ContentEntityConfirmFormBase {

  /**
   * {@inheritdoc}
   */
  public function getQuestion() {
    return $this
      ->t('Are you sure you want to delete the %result Live Meeting Result?', [
      '%result' => $this->entity
        ->label(),
    ]);
  }

  /**
   * {@inheritdoc}
   */
  public function getConfirmText() {
    return $this
      ->t('Delete');
  }

  /**
   * {@inheritdoc}
   */
  public function getCancelUrl() {
    return Url::fromRoute('entity.opigno_moxtra_meeting_result.canonical', [
      'opigno_moxtra_meeting_result' => $this->entity
        ->id(),
    ]);
  }

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    $this->entity
      ->delete();
    $this
      ->messenger()
      ->addMessage($this
      ->t('The Live Meeting Result %result has been deleted.', [
      '%result' => $this->entity
        ->label(),
    ]));
  }

}

Classes

Namesort descending Description
MeetingResultDeleteForm Provides a form for deleting a opigno_moxtra_meeting_result entity.