function Feed::refreshItems

Same name and namespace in other branches
  1. 8.9.x core/modules/aggregator/src/Entity/Feed.php \Drupal\aggregator\Entity\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

File

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

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;
}

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