You are here

public function MediaFeedsInternetProvider::save in Media Feeds 7

Same name and namespace in other branches
  1. 7.2 includes/MediaFeedsInternetProvider.inc \MediaFeedsInternetProvider::save()

Let the provider save the file. Since providers don't use the workaround at MediaFeedsProviderWrapper::getFileObject() internally, hook into that process using hook_file_presave().

MediaFeedsProviderWrapper::$currentExistingFile will be the fid of an existing file, if a workaround is required. Otherwise it is FALSE.

Overrides MediaFeedsProvider::save

File

includes/MediaFeedsInternetProvider.inc, line 110
Provides a wrapper class for media_internet providers.

Class

MediaFeedsInternetProvider
Wraps a media_internet provider to implement the interface of MediaFeedsProvider and provide workarounds for some issues. As the issues get fixed the workarounds can be removed.

Code

public function save() {
  self::$currentExistingFile = $this
    ->getExistingFile();
  $file = $this->provider
    ->save();
  self::$currentExistingFile = FALSE;
  return $file;
}