You are here

protected function FeedsFileFetcher::deleteFile in Feeds 7.2

Same name and namespace in other branches
  1. 7 plugins/FeedsFileFetcher.inc \FeedsFileFetcher::deleteFile()

Deletes a file.

Parameters

int $fid: The file id.

int $feed_nid: The feed node's id, or 0 if a standalone feed.

Return value

bool|array TRUE for success, FALSE in the event of an error, or an array if the file is being used by any modules.

See also

file_delete()

3 calls to FeedsFileFetcher::deleteFile()
FeedsFileFetcher::afterImport in plugins/FeedsFileFetcher.inc
Overrides FeedsFetcher::afterImport().
FeedsFileFetcher::sourceDelete in plugins/FeedsFileFetcher.inc
Overrides parent::sourceDelete().
FeedsFileFetcher::sourceSave in plugins/FeedsFileFetcher.inc
Overrides parent::sourceSave().

File

plugins/FeedsFileFetcher.inc, line 345
Home of the FeedsFileFetcher and related classes.

Class

FeedsFileFetcher
Fetches data via HTTP.

Code

protected function deleteFile($fid, $feed_nid) {
  if ($file = file_load($fid)) {
    file_usage_delete($file, 'feeds', get_class($this), $feed_nid);
    return file_delete($file);
  }
  return FALSE;
}