public static function FeedImportSQLHashes::getExpired in Feed Import 7.3
Returns an array of expired entity ids keyed by entity name
Parameters
string $name: Feed machine name
int $max: Max number of ids or 0 for all
Return value
array An array of expired items. Format: entity_name: hash_id: enity_id
Overrides FeedImportStaticHashManager::getExpired
File
- feed_import_base/
inc/ feed_import.inc, line 2008 - This file contains Feed Import helpers.
Class
- FeedImportSQLHashes
- This class implements SQL hash storage
Code
public static function getExpired($name, $max = 0) {
$q = db_select('feed_import_hashes', 'f')
->fields('f', array(
'entity',
'id',
'entity_id',
))
->condition('feed_machine_name', $name)
->condition('expire', array(
static::MARK_PROTECTED + 1,
time(),
), 'BETWEEN');
if ($max) {
$q
->range(0, $max);
}
$q = $q
->execute();
$ret = array();
while ($r = $q
->fetch(PDO::FETCH_ASSOC)) {
$ret[$r['entity']][$r['id']] = $r['entity_id'];
}
return $ret;
}