TranscodeJobDeleteForm.php in Video 8.2
Namespace
Drupal\video_transcode\FormFile
modules/video_transcode/src/Form/TranscodeJobDeleteForm.phpView source
<?php
namespace Drupal\video_transcode\Form;
use Drupal\Core\Entity\ContentEntityConfirmFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
/**
* Provides a form for deleting a trnascode job entity.
*
* @ingroup video_transcode
*/
class TranscodeJobDeleteForm extends ContentEntityConfirmFormBase {
/**
* {@inheritdoc}
*/
public function getQuestion() {
return $this
->t('Are you sure you want to delete entity %name?', array(
'%name' => $this->entity
->label(),
));
}
/**
* {@inheritdoc}
*
* If the delete command is canceled, return to the transcode jobs list.
*/
public function getCancelUrl() {
return new Url('entity.video_transcode_job.collection');
}
/**
* {@inheritdoc}
*/
public function getConfirmText() {
return $this
->t('Delete');
}
/**
* {@inheritdoc}
*
* Delete the entity and log the event. logger() replaces the watchdog.
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$entity = $this
->getEntity();
$entity
->delete();
$this
->logger('video_transcode')
->notice('@type: deleted %title.', array(
'@type' => $this->entity
->bundle(),
'%title' => $this->entity
->label(),
));
$form_state
->setRedirect('entity.video_transcode_job.collection');
}
}
Classes
Name![]() |
Description |
---|---|
TranscodeJobDeleteForm | Provides a form for deleting a trnascode job entity. |