DeleteForm.php in Drupal 8
File
core/modules/comment/src/Form/DeleteForm.php
View source
<?php
namespace Drupal\comment\Form;
use Drupal\Core\Entity\ContentEntityDeleteForm;
class DeleteForm extends ContentEntityDeleteForm {
public function getCancelUrl() {
return $this->entity
->get('entity_id')->entity
->toUrl();
}
protected function getRedirectUrl() {
return $this
->getCancelUrl();
}
public function getDescription() {
return $this
->t('Any replies to this comment will be lost. This action cannot be undone.');
}
protected function getDeletionMessage() {
return $this
->t('The comment and all its replies have been deleted.');
}
public function logDeletionMessage() {
$this
->logger('comment')
->notice('Deleted comment @cid and its replies.', [
'@cid' => $this->entity
->id(),
]);
}
}
Classes
Name |
Description |
DeleteForm |
Provides the comment delete confirmation form. |