You are here

class MigrateFileFid in Migrate 7.2

Handle the degenerate case where we already have a file ID.

Hierarchy

Expanded class hierarchy of MigrateFileFid

File

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

View source
class MigrateFileFid extends MigrateFileBase {

  /**
   * Implementation of MigrateFileInterface::processFile().
   *
   * @param $value
   *  An existing file entity ID (fid).
   * @param $owner
   *  User ID (uid) to be the owner of the file. Ignored in this case.
   *
   * @return int
   *  The file entity corresponding to the fid that was passed in.
   */
  public function processFile($value, $owner) {
    $this
      ->markForPreservation($value);
    return file_load($value);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MigrateFileBase::$defaultFile protected property An optional file object to use as a default starting point for building the file entity.
MigrateFileBase::$fileReplace protected property How to handle destination filename collisions.
MigrateFileBase::$preserveFiles protected property Set to TRUE to prevent file deletion on rollback.
MigrateFileBase::createFileEntity protected function Setup a file entity object suitable for saving.
MigrateFileBase::fields public static function Default implementation of MigrateFileInterface::fields(). Overrides MigrateFileInterface::fields 1
MigrateFileBase::FILE_EXISTS_REUSE constant Extension of the core FILE_EXISTS_* constants, offering an alternative to reuse the existing file if present as-is (core only offers the options of replacing it or renaming to avoid collision).
MigrateFileBase::markForPreservation protected function If asked to preserve files from deletion on rollback, add a file_usage entry.
MigrateFileBase::__construct public function 1
MigrateFileFid::processFile public function Implementation of MigrateFileInterface::processFile(). Overrides MigrateFileInterface::processFile