Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 18 |
| NodeDeleteForm | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
12 | |
0.00% |
0 / 18 |
| getDeletionMessage | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 15 |
|||
| logDeletionMessage | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
| <?php | |
| /** | |
| * @file | |
| * Contains \Drupal\node\Form\NodeDeleteForm. | |
| */ | |
| namespace Drupal\node\Form; | |
| use Drupal\Core\Entity\ContentEntityDeleteForm; | |
| /** | |
| * Provides a form for deleting a node. | |
| */ | |
| class NodeDeleteForm extends ContentEntityDeleteForm { | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| protected function getDeletionMessage() { | |
| /** @var \Drupal\node\NodeInterface $entity */ | |
| $entity = $this->getEntity(); | |
| $node_type_storage = $this->entityManager->getStorage('node_type'); | |
| $node_type = $node_type_storage->load($entity->bundle())->label(); | |
| if (!$entity->isDefaultTranslation()) { | |
| return $this->t('@language translation of the @type %label has been deleted.', [ | |
| '@language' => $entity->language()->getName(), | |
| '@type' => $node_type, | |
| '%label' => $entity->label(), | |
| ]); | |
| } | |
| return $this->t('The @type %title has been deleted.', array( | |
| '@type' => $node_type, | |
| '%title' => $this->getEntity()->label(), | |
| )); | |
| } | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| protected function logDeletionMessage() { | |
| /** @var \Drupal\node\NodeInterface $entity */ | |
| $entity = $this->getEntity(); | |
| $this->logger('content')->notice('@type: deleted %title.', ['@type' => $entity->getType(), '%title' => $entity->label()]); | |
| } | |
| } |