3 namespace Drupal\node\Form;
5 use Drupal\Core\Entity\ContentEntityDeleteForm;
8 * Provides a form for deleting a node.
12 class NodeDeleteForm extends ContentEntityDeleteForm {
17 protected function getDeletionMessage() {
18 /** @var \Drupal\node\NodeInterface $entity */
19 $entity = $this->getEntity();
21 $node_type_storage = $this->entityManager->getStorage('node_type');
22 $node_type = $node_type_storage->load($entity->bundle())->label();
24 if (!$entity->isDefaultTranslation()) {
25 return $this->t('@language translation of the @type %label has been deleted.', [
26 '@language' => $entity->language()->getName(),
27 '@type' => $node_type,
28 '%label' => $entity->label(),
32 return $this->t('The @type %title has been deleted.', [
33 '@type' => $node_type,
34 '%title' => $this->getEntity()->label(),
41 protected function logDeletionMessage() {
42 /** @var \Drupal\node\NodeInterface $entity */
43 $entity = $this->getEntity();
44 $this->logger('content')->notice('@type: deleted %title.', ['@type' => $entity->getType(), '%title' => $entity->label()]);