Skip to content

Instantly share code, notes, and snippets.

@mikeryan776
Created May 25, 2016 15:56
Show Gist options
  • Save mikeryan776/a09607e4e4cad07fb31d25d8376d1623 to your computer and use it in GitHub Desktop.
Save mikeryan776/a09607e4e4cad07fb31d25d8376d1623 to your computer and use it in GitHub Desktop.
<?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