SupportTicketDeleteForm.php in Support Ticketing System 8
File
modules/support_ticket/src/Form/SupportTicketDeleteForm.php
View source
<?php
namespace Drupal\support_ticket\Form;
use Drupal\Core\Entity\ContentEntityDeleteForm;
class SupportTicketDeleteForm extends ContentEntityDeleteForm {
protected function getDeletionMessage() {
$entity = $this
->getEntity();
$support_ticket_type_storage = $this->entityManager
->getStorage('support_ticket_type');
$support_ticket_type = $support_ticket_type_storage
->load($entity
->bundle())
->label();
if (!$entity
->isDefaultTranslation()) {
return $this
->t('@language translation of the @type %label has been deleted.', [
'@language' => $entity
->language()
->getName(),
'@type' => $support_ticket_type,
'%label' => $entity
->label(),
]);
}
return $this
->t('The @type %title has been deleted.', array(
'@type' => $support_ticket_type,
'%title' => $this
->getEntity()
->label(),
));
}
protected function logDeletionMessage() {
$entity = $this
->getEntity();
$this
->logger('content')
->notice('@type: deleted %title.', [
'@type' => $entity
->getType(),
'%title' => $entity
->label(),
]);
}
}