You are here

public function EntityProcessorBase::getExpiredIds in Feeds 8.3

Returns feed item ID's to expire.

Parameters

\Drupal\feeds\FeedInterface $feed: The feed for which to get the expired item ID's.

int $time: (optional) All items produced by this configuration that are older than REQUEST_TIME - $time that are expired. If null, the processor should use internal configuration. Defaults to null.

Return value

array A list of item ID's.

Overrides ProcessorInterface::getExpiredIds

File

src/Feeds/Processor/EntityProcessorBase.php, line 809

Class

EntityProcessorBase
Defines a base entity processor.

Namespace

Drupal\feeds\Feeds\Processor

Code

public function getExpiredIds(FeedInterface $feed, $time = NULL) {
  if ($time === NULL) {
    $time = $this
      ->expiryTime();
  }
  if ($time == static::EXPIRE_NEVER) {
    return;
  }
  $expire_time = \Drupal::service('datetime.time')
    ->getRequestTime() - $time;
  return $this->entityTypeManager
    ->getStorage($this
    ->entityType())
    ->getQuery()
    ->condition('feeds_item.target_id', $feed
    ->id())
    ->condition('feeds_item.imported', $expire_time, '<')
    ->execute();
}