function ContentEntityDeleteForm::logDeletionMessage

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php \Drupal\Core\Entity\ContentEntityDeleteForm::logDeletionMessage()
  2. 10 core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php \Drupal\Core\Entity\ContentEntityDeleteForm::logDeletionMessage()
  3. 11.x 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();
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.