Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / web / core / modules / comment / src / Form / DeleteForm.php
1 <?php
2
3 namespace Drupal\comment\Form;
4
5 use Drupal\Core\Entity\ContentEntityDeleteForm;
6
7 /**
8  * Provides the comment delete confirmation form.
9  *
10  * @internal
11  */
12 class DeleteForm extends ContentEntityDeleteForm {
13
14   /**
15    * {@inheritdoc}
16    */
17   public function getCancelUrl() {
18     // Point to the entity of which this comment is a reply.
19     return $this->entity->get('entity_id')->entity->urlInfo();
20   }
21
22   /**
23    * {@inheritdoc}
24    */
25   protected function getRedirectUrl() {
26     return $this->getCancelUrl();
27   }
28
29   /**
30    * {@inheritdoc}
31    */
32   public function getDescription() {
33     return $this->t('Any replies to this comment will be lost. This action cannot be undone.');
34   }
35
36   /**
37    * {@inheritdoc}
38    */
39   protected function getDeletionMessage() {
40     return $this->t('The comment and all its replies have been deleted.');
41   }
42
43   /**
44    * {@inheritdoc}
45    */
46   public function logDeletionMessage() {
47     $this->logger('comment')->notice('Deleted comment @cid and its replies.', ['@cid' => $this->entity->id()]);
48   }
49
50 }