class DeleteForm
Same name in this branch
- 9 core/modules/forum/src/Form/DeleteForm.php \Drupal\forum\Form\DeleteForm
Same name and namespace in other branches
- 11.x core/modules/comment/src/Form/DeleteForm.php \Drupal\comment\Form\DeleteForm
Provides the comment delete confirmation form.
@internal
Hierarchy
- class \Drupal\Core\Form\FormBase extends \Drupal\Core\Form\FormInterface, \Drupal\Core\DependencyInjection\ContainerInjectionInterface uses \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Logger\LoggerChannelTrait, \Drupal\Core\Messenger\MessengerTrait, \Drupal\Core\Routing\RedirectDestinationTrait, \Drupal\Core\StringTranslation\StringTranslationTrait
- class \Drupal\Core\Entity\EntityForm extends \Drupal\Core\Entity\EntityFormInterface implements \Drupal\Core\Form\FormBase
- class \Drupal\Core\Entity\ContentEntityForm extends \Drupal\Core\Entity\ContentEntityFormInterface implements \Drupal\Core\Entity\EntityForm
- class \Drupal\Core\Entity\ContentEntityConfirmFormBase extends \Drupal\Core\Form\ConfirmFormInterface implements \Drupal\Core\Entity\ContentEntityForm
- class \Drupal\Core\Entity\ContentEntityDeleteForm uses \Drupal\Core\Entity\EntityDeleteFormTrait implements \Drupal\Core\Entity\ContentEntityConfirmFormBase
- class \Drupal\comment\Form\DeleteForm implements \Drupal\Core\Entity\ContentEntityDeleteForm
- class \Drupal\Core\Entity\ContentEntityDeleteForm uses \Drupal\Core\Entity\EntityDeleteFormTrait implements \Drupal\Core\Entity\ContentEntityConfirmFormBase
- class \Drupal\Core\Entity\ContentEntityConfirmFormBase extends \Drupal\Core\Form\ConfirmFormInterface implements \Drupal\Core\Entity\ContentEntityForm
- class \Drupal\Core\Entity\ContentEntityForm extends \Drupal\Core\Entity\ContentEntityFormInterface implements \Drupal\Core\Entity\EntityForm
- class \Drupal\Core\Entity\EntityForm extends \Drupal\Core\Entity\EntityFormInterface implements \Drupal\Core\Form\FormBase
Expanded class hierarchy of DeleteForm
File
-
core/
modules/ comment/ src/ Form/ DeleteForm.php, line 12
Namespace
Drupal\comment\FormView source
class DeleteForm extends ContentEntityDeleteForm {
/**
* {@inheritdoc}
*/
public function getCancelUrl() {
// Point to the entity of which this comment is a reply.
return $this->entity
->get('entity_id')->entity
->toUrl();
}
/**
* {@inheritdoc}
*/
protected function getRedirectUrl() {
return $this->getCancelUrl();
}
/**
* {@inheritdoc}
*/
public function getDescription() {
return $this->t('Any replies to this comment will be lost. This action cannot be undone.');
}
/**
* {@inheritdoc}
*/
protected function getDeletionMessage() {
return $this->t('The comment and all its replies have been deleted.');
}
/**
* {@inheritdoc}
*/
public function logDeletionMessage() {
$this->logger('comment')
->notice('Deleted comment @cid and its replies.', [
'@cid' => $this->entity
->id(),
]);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.