You are here

public function MigrateFileUriAsIs::processFile in Migrate 7.2

Create or link to a Drupal file entity.

Parameters

$value: A class-specific value (URI, pre-existing file ID, file blob, ...) representing file content.

$owner: uid of an account to be recorded as the file owner.

Return value

object File entity being created or referenced.

Overrides MigrateFileInterface::processFile

File

plugins/destinations/file.inc, line 178
Support for file entity as destination. Note that File Fields have their own destination in fields.inc

Class

MigrateFileUriAsIs
The simplest possible file class - where the value is a remote URI which simply needs to be saved as the URI on the destination side, with no attempt to copy or otherwise use it.

Code

public function processFile($value, $owner) {
  $file = file_save($this
    ->createFileEntity($value, $owner));
  return $file;
}