class FeedItemsDeleteForm
Provides a deletion confirmation form for items that belong to a feed.
@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\aggregator\Form\FeedItemsDeleteForm 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 FeedItemsDeleteForm
File
-
core/
modules/ aggregator/ src/ Form/ FeedItemsDeleteForm.php, line 14
Namespace
Drupal\aggregator\FormView source
class FeedItemsDeleteForm extends ContentEntityConfirmFormBase {
/**
* {@inheritdoc}
*/
public function getQuestion() {
return $this->t('Are you sure you want to delete all items from the feed %feed?', [
'%feed' => $this->entity
->label(),
]);
}
/**
* {@inheritdoc}
*/
public function getCancelUrl() {
return new Url('aggregator.admin_overview');
}
/**
* {@inheritdoc}
*/
public function getConfirmText() {
return $this->t('Delete items');
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->entity
->deleteItems();
$form_state->setRedirectUrl($this->getCancelUrl());
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.