function AggregatorController::feedRefresh

Same name in other branches
  1. 8.9.x core/modules/aggregator/src/Controller/AggregatorController.php \Drupal\aggregator\Controller\AggregatorController::feedRefresh()

Refreshes a feed, then redirects to the overview page.

Parameters

\Drupal\aggregator\FeedInterface $aggregator_feed: An object describing the feed to be refreshed.

Return value

\Symfony\Component\HttpFoundation\RedirectResponse A redirection to the admin overview page.

Throws

\Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException If the query token is missing or invalid.

1 string reference to 'AggregatorController::feedRefresh'
aggregator.routing.yml in core/modules/aggregator/aggregator.routing.yml
core/modules/aggregator/aggregator.routing.yml

File

core/modules/aggregator/src/Controller/AggregatorController.php, line 93

Class

AggregatorController
Returns responses for aggregator module routes.

Namespace

Drupal\aggregator\Controller

Code

public function feedRefresh(FeedInterface $aggregator_feed) {
    $message = $aggregator_feed->refreshItems() ? $this->t('There is new syndicated content from %site.', [
        '%site' => $aggregator_feed->label(),
    ]) : $this->t('There is no new syndicated content from %site.', [
        '%site' => $aggregator_feed->label(),
    ]);
    $this->messenger()
        ->addStatus($message);
    return $this->redirect('aggregator.admin_overview');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.