You are here

protected function ContentEntityDeleteForm::logDeletionMessage in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php \Drupal\Core\Entity\ContentEntityDeleteForm::logDeletionMessage()
  2. 9 core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php \Drupal\Core\Entity\ContentEntityDeleteForm::logDeletionMessage()
1 call to ContentEntityDeleteForm::logDeletionMessage()
ContentEntityDeleteForm::submitForm in core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php
This is the default entity object builder function. It is called before any other submit handler to build the new entity object to be used by the following submit handlers. At this point of the form workflow the entity is validated and the form state…
2 methods override ContentEntityDeleteForm::logDeletionMessage()
DeleteForm::logDeletionMessage in core/modules/comment/src/Form/DeleteForm.php
NodeDeleteForm::logDeletionMessage in core/modules/node/src/Form/NodeDeleteForm.php

File

core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php, line 109

Class

ContentEntityDeleteForm
Provides a generic base class for a content entity deletion form.

Namespace

Drupal\Core\Entity

Code

protected function logDeletionMessage() {

  /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
  $entity = $this
    ->getEntity();
  if (!$entity
    ->isDefaultTranslation()) {
    $this
      ->logger($entity
      ->getEntityType()
      ->getProvider())
      ->notice('The @entity-type %label @language translation has been deleted.', [
      '@entity-type' => $entity
        ->getEntityType()
        ->getSingularLabel(),
      '%label' => $entity
        ->label(),
      '@language' => $entity
        ->language()
        ->getName(),
    ]);
  }
  else {
    $this
      ->traitLogDeletionMessage();
  }
}