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