You are here

protected function SupportTicketDeleteForm::getDeletionMessage in Support Ticketing System 8

Overrides ContentEntityDeleteForm::getDeletionMessage

File

modules/support_ticket/src/Form/SupportTicketDeleteForm.php, line 20
Contains \Drupal\support_ticket\Form\SupportTicketDeleteForm.

Class

SupportTicketDeleteForm
Provides a form for deleting a support ticket.

Namespace

Drupal\support_ticket\Form

Code

protected function getDeletionMessage() {

  /** @var \Drupal\support_ticket\SupportTicketInterface $entity */
  $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(),
  ));
}