You are here

public function FeedsDataProcessor::expire in Feeds 6

Implement expire().

Overrides FeedsProcessor::expire

File

plugins/FeedsDataProcessor.inc, line 85
Definition of FeedsDataProcessor.

Class

FeedsDataProcessor
Creates simple table records from feed items. Uses Data module.

Code

public function expire($time = NULL) {
  if ($time === NULL) {
    $time = $this
      ->expiryTime();
  }
  if ($time == FEEDS_EXPIRE_NEVER) {
    return FEEDS_BATCH_COMPLETE;
  }
  $clause = array(
    'timestamp' => array(
      '<',
      FEEDS_REQUEST_TIME - $time,
    ),
  );
  $num = $this
    ->handler()
    ->delete($clause);
  drupal_set_message(format_plural($num, 'Expired @number record from @table.', 'Expired @number records from @table.', array(
    '@number' => $num,
    '@table' => $this
      ->tableName(),
  )));
  return FEEDS_BATCH_COMPLETE;
}