Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Drupalcustom_url_migratepluginmigratefield;
- use DrupalmigratePluginMigrationInterface;
- use Drupalmigrate_drupalPluginmigratefieldFieldPluginBase;
- /**
- * @MigrateField(
- * id = "url",
- * core = {7},
- * type_map = {
- * "url" = "link"
- * },
- * source_module = "url",
- * destination_module = "link"
- * )
- */
- class url extends FieldPluginBase {
- /**
- * {@inheritdoc}
- */
- public function getFieldWidgetMap() {
- return [
- 'url' => 'link',
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function getFieldFormatterMap() {
- return [
- //'default' => 'link',
- //'url' => 'link',
- 'url_external' => 'link',
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function processFieldValues(MigrationInterface $migration, $field_name, $data) {
- $process = [
- 'plugin' => 'sub_process',
- 'source' => $field_name,
- 'process' => [
- 'uri' => 'value',
- ],
- ];
- $migration->setProcessOfProperty($field_name, $process);
- }
- }
Add Comment
Please, Sign In to add comment