You are here

public function MediaFeedsRemoteProvider::getFileObject in Media Feeds 7

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

Create a file object like remote_stream_wrapper_file_create_by_uri does, only don't save it directly.

Overrides MediaFeedsProvider::getFileObject

1 call to MediaFeedsRemoteProvider::getFileObject()
MediaFeedsRemoteProvider::save in includes/MediaFeedsRemoteProvider.inc
Save the file or return an existing one.

File

includes/MediaFeedsRemoteProvider.inc, line 25
Map files using the remote_stream_wrapper module.

Class

MediaFeedsRemoteProvider
Class for mapping values using the remote_stream_wrapper_module.

Code

public function getFileObject() {
  $file = new stdClass();
  $file->fid = NULL;
  $file->uri = $this->uri;
  $file->filename = basename($file->uri);
  $file->filemime = file_get_mimetype($file->uri);
  $file->uid = $GLOBALS['user']->uid;
  $file->status = FILE_STATUS_PERMANENT;
  return $file;
}