Migrate the bio field in the story migration.

This commit is contained in:
David Valdez 2019-10-02 18:50:33 -05:00
parent 9108d898df
commit 7b0ff5e881
2 changed files with 43 additions and 4 deletions

View file

@ -0,0 +1,29 @@
<?php
namespace Drupal\geo_upgrade\Plugin\migrate\process;
use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\MigrateSkipRowException;
use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\Row;
/**
* @MigrateProcessPlugin(
* id = "geo_story_bio"
* )
*/
class StoryBio extends ProcessPluginBase {
/**
* {@inheritdoc}
*/
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
$result = [];
foreach ($value[0] as $key => $item) {
$result[$key] = $item;
$result[$key]['bio'] = isset($value[1][0]['value']) ? $value[1][0]['value'] : '';
}
return $result;
}
}