You are here

public function AggregatorController::feedRefresh in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 100
Contains \Drupal\aggregator\Controller\AggregatorController.

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.', array(
    '%site' => $aggregator_feed
      ->label(),
  )) : $this
    ->t('There is no new syndicated content from %site.', array(
    '%site' => $aggregator_feed
      ->label(),
  ));
  drupal_set_message($message);
  return $this
    ->redirect('aggregator.admin_overview');
}