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.
12 class FeedItemsDeleteForm extends ContentEntityConfirmFormBase {
17 public function getQuestion() {
18 return $this->t('Are you sure you want to delete all items from the feed %feed?', ['%feed' => $this->entity->label()]);
24 public function getCancelUrl() {
25 return new Url('aggregator.admin_overview');
31 public function getConfirmText() {
32 return $this->t('Delete items');
38 public function submitForm(array &$form, FormStateInterface $form_state) {
39 $this->entity->deleteItems();
41 $form_state->setRedirectUrl($this->getCancelUrl());