Feed::refreshItems

public Feed::refreshItems()

Updates the feed items by triggering the import process.

This will also update the last checked time of the feed and save it.

Return value

bool TRUE if there is new content for the feed FALSE otherwise.

Overrides FeedInterface::refreshItems

See also

\Drupal\aggregator\ItemsImporterInterface::refresh()

File

core/modules/aggregator/src/Entity/Feed.php, line 76

Class

Feed
Defines the aggregator feed entity class.

Namespace

Drupal\aggregator\Entity

Code

public function refreshItems() {
  $success = \Drupal::service('aggregator.items.importer')->refresh($this);

  // Regardless of successful or not, indicate that it has been checked.
  $this->setLastCheckedTime(REQUEST_TIME);
  $this->setQueuedTime(0);
  $this->save();

  return $success;
}
doc_Drupal
2016-10-29 09:09:57
Comments
Leave a Comment

Please login to continue.