Retrieve temporary files that are older than DRUPAL_MAXIMUM_TEMP_FILE_AGE.
A list of files to be deleted.
public function retrieveTemporaryFiles() {
// Use separate placeholders for the status to avoid a bug in some versions
// of PHP. See http://drupal.org/node/352956.
return db_query('SELECT fid FROM {' . $this->entityInfo['base_table'] . '} WHERE status <> :permanent AND timestamp < :timestamp', array(
':permanent' => FILE_STATUS_PERMANENT,
':timestamp' => REQUEST_TIME - DRUPAL_MAXIMUM_TEMP_FILE_AGE,
));
}