3 namespace Drupal\comment\Form;
5 use Drupal\Core\Entity\ContentEntityDeleteForm;
8 * Provides the comment delete confirmation form.
12 class DeleteForm extends ContentEntityDeleteForm {
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();
25 protected function getRedirectUrl() {
26 return $this->getCancelUrl();
32 public function getDescription() {
33 return $this->t('Any replies to this comment will be lost. This action cannot be undone.');
39 protected function getDeletionMessage() {
40 return $this->t('The comment and all its replies have been deleted.');
46 public function logDeletionMessage() {
47 $this->logger('comment')->notice('Deleted comment @cid and its replies.', ['@cid' => $this->entity->id()]);