Created
May 25, 2016 15:56
-
-
Save mikeryan776/a09607e4e4cad07fb31d25d8376d1623 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\migrate_mine\Plugin\migrate\process; | |
use Drupal\file\Plugin\migrate\process\d6\CckFile; | |
use Drupal\migrate\Plugin\MigrationInterface; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
/** | |
* @MigrateProcessPlugin( | |
* id = "my_cck_file" | |
* ) | |
*/ | |
class MyCckFile extends CckFile { | |
/** | |
* {@inheritdoc} | |
*/ | |
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) { | |
// Configure the migration process plugin to look up migrated IDs from | |
// our file migration (overriding the default d6_file). | |
$migration_plugin_configuration = [ | |
'source' => ['fid'], | |
'migration' => 'my_file', | |
]; | |
return new static( | |
$configuration, | |
$plugin_id, | |
$plugin_definition, | |
$migration, | |
$container->get('plugin.manager.migrate.process')->createInstance('migration', $migration_plugin_configuration, $migration) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment