protected function MigrateFileFieldBaseHandler::destinationDir in Migrate 7.2
Determine where the migrated file should go.
Parameters
$field_info: Field API info on the general field.
$instance: Field API info on the field instance for this entity type.
Return value
string Directory relative to the Drupal public files directory.
1 call to MigrateFileFieldBaseHandler::destinationDir()
- MigrateFileFieldBaseHandler::prepare in plugins/
destinations/ fields.inc - Implementation of MigrateFieldHandler::prepare().
File
- plugins/
destinations/ fields.inc, line 771 - Support for processing entity fields
Class
- MigrateFileFieldBaseHandler
- The next generation of file field handler. This class focuses on the file field itself, and offloads understanding of obtaining the actual file and dealing with the file entity to an embedded MigrateFileInterface instance.
Code
protected function destinationDir($field_info, $instance) {
// Only apply for file/image types
if (isset($instance['settings']['file_directory'])) {
$destination_dir = file_field_widget_uri($field_info, $instance);
}
else {
$destination_dir = 'public://';
}
return $destination_dir;
}