3 namespace Drupal\comment\Form;
5 use Drupal\Core\Entity\ContentEntityDeleteForm;
8 * Provides the comment delete confirmation form.
10 class DeleteForm extends ContentEntityDeleteForm {
15 public function getCancelUrl() {
16 // Point to the entity of which this comment is a reply.
17 return $this->entity->get('entity_id')->entity->urlInfo();
23 protected function getRedirectUrl() {
24 return $this->getCancelUrl();
30 public function getDescription() {
31 return $this->t('Any replies to this comment will be lost. This action cannot be undone.');
37 protected function getDeletionMessage() {
38 return $this->t('The comment and all its replies have been deleted.');
44 public function logDeletionMessage() {
45 $this->logger('comment')->notice('Deleted comment @cid and its replies.', ['@cid' => $this->entity->id()]);