Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/EntityDeleteFormTrait.php \Drupal\Core\Entity\EntityDeleteFormTrait::getDeletionMessage()
  2. 9 core/lib/Drupal/Core/Entity/EntityDeleteFormTrait.php \Drupal\Core\Entity\EntityDeleteFormTrait::getDeletionMessage()

Gets the message to display to the user after deleting the entity.

Return value

string The translated string of the deletion message.

2 calls to EntityDeleteFormTrait::getDeletionMessage()
ContentEntityDeleteForm::getDeletionMessage in core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php
EntityDeleteFormTrait::submitForm in core/lib/Drupal/Core/Entity/EntityDeleteFormTrait.php
3 methods override EntityDeleteFormTrait::getDeletionMessage()
BlockDeleteForm::getDeletionMessage in core/modules/block/src/Form/BlockDeleteForm.php
Gets the message to display to the user after deleting the entity.
LanguageDeleteForm::getDeletionMessage in core/modules/language/src/Form/LanguageDeleteForm.php
Gets the message to display to the user after deleting the entity.
VocabularyDeleteForm::getDeletionMessage in core/modules/taxonomy/src/Form/VocabularyDeleteForm.php
Gets the message to display to the user after deleting the entity.

File

core/lib/Drupal/Core/Entity/EntityDeleteFormTrait.php, line 66

Class

EntityDeleteFormTrait
Provides a trait for an entity deletion form.

Namespace

Drupal\Core\Entity

Code

protected function getDeletionMessage() {
  $entity = $this
    ->getEntity();
  return $this
    ->t('The @entity-type %label has been deleted.', [
    '@entity-type' => $entity
      ->getEntityType()
      ->getSingularLabel(),
    '%label' => $entity
      ->label() ?? $entity
      ->id(),
  ]);
}