MeetingResultDeleteForm.php in Opigno Moxtra 3.x
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;
class MeetingResultDeleteForm extends ContentEntityConfirmFormBase {
public function getQuestion() {
return $this
->t('Are you sure you want to delete the %result Live Meeting Result?', [
'%result' => $this->entity
->label(),
]);
}
public function getConfirmText() {
return $this
->t('Delete');
}
public function getCancelUrl() {
return Url::fromRoute('entity.opigno_moxtra_meeting_result.canonical', [
'opigno_moxtra_meeting_result' => $this->entity
->id(),
]);
}
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(),
]));
}
}