3 namespace Drupal\aggregator\Form;
5 use Drupal\Core\Entity\ContentEntityConfirmFormBase;
6 use Drupal\Core\Form\FormStateInterface;
10 * Provides a deletion confirmation form for items that belong to a feed.
14 class FeedItemsDeleteForm extends ContentEntityConfirmFormBase {
19 public function getQuestion() {
20 return $this->t('Are you sure you want to delete all items from the feed %feed?', ['%feed' => $this->entity->label()]);
26 public function getCancelUrl() {
27 return new Url('aggregator.admin_overview');
33 public function getConfirmText() {
34 return $this->t('Delete items');
40 public function submitForm(array &$form, FormStateInterface $form_state) {
41 $this->entity->deleteItems();
43 $form_state->setRedirectUrl($this->getCancelUrl());