class MigrateFileFid in Migrate 7.2
Handle the degenerate case where we already have a file ID.
Hierarchy
- class \MigrateFileBase implements MigrateFileInterface
- class \MigrateFileFid
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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MigrateFileBase:: |
protected | property | An optional file object to use as a default starting point for building the file entity. | |
MigrateFileBase:: |
protected | property | How to handle destination filename collisions. | |
MigrateFileBase:: |
protected | property | Set to TRUE to prevent file deletion on rollback. | |
MigrateFileBase:: |
protected | function | Setup a file entity object suitable for saving. | |
MigrateFileBase:: |
public static | function |
Default implementation of MigrateFileInterface::fields(). Overrides MigrateFileInterface:: |
1 |
MigrateFileBase:: |
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:: |
protected | function | If asked to preserve files from deletion on rollback, add a file_usage entry. | |
MigrateFileBase:: |
public | function | 1 | |
MigrateFileFid:: |
public | function |
Implementation of MigrateFileInterface::processFile(). Overrides MigrateFileInterface:: |