You are here

protected function FeedsFileFetcher::deleteFile in Feeds 8.2

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()

2 calls to FeedsFileFetcher::deleteFile()
FeedsFileFetcher::sourceDelete in lib/Drupal/feeds/Plugin/feeds/fetcher/FeedsFileFetcher.php
Overrides parent::sourceDelete().
FeedsFileFetcher::sourceSave in lib/Drupal/feeds/Plugin/feeds/fetcher/FeedsFileFetcher.php
Overrides parent::sourceSave().

File

lib/Drupal/feeds/Plugin/feeds/fetcher/FeedsFileFetcher.php, line 308
Home of the FeedsFileFetcher and related classes.

Class

FeedsFileFetcher
Defines a file fetcher.

Namespace

Drupal\feeds\Plugin\feeds\fetcher

Code

protected function deleteFile($fid, $feed_nid) {
  if ($file = file_load($fid)) {
    file_usage()
      ->delete($file, 'feeds', get_class($this), $feed_nid);
  }
  return FALSE;
}