FieldSettings.php in Zircon Profile 8
File
core/modules/field/src/Plugin/migrate/process/d7/FieldSettings.php
View source
<?php
namespace Drupal\field\Plugin\migrate\process\d7;
use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\Row;
class FieldSettings extends ProcessPluginBase {
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
$value = $row
->getSourceProperty('settings');
switch ($row
->getSourceProperty('type')) {
case 'image':
if (!is_array($value['default_image'])) {
$value['default_image'] = array(
'uuid' => '',
);
}
break;
case 'taxonomy_term_reference':
$value['target_type'] = 'taxonomy_term';
break;
default:
break;
}
return $value;
}
}
Classes
Name |
Description |
FieldSettings |
Plugin annotation
@MigrateProcessPlugin(
id = "d7_field_settings"
) |