InlineFormEntityFieldInstanceSettings.php in Inline Entity Form 8
File
src/Plugin/migrate/process/InlineFormEntityFieldInstanceSettings.php
View source
<?php
namespace Drupal\inline_entity_form\Plugin\migrate\process;
use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\Row;
class InlineFormEntityFieldInstanceSettings extends ProcessPluginBase {
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
if ($row
->getSourceProperty('type') === 'entityreference') {
$widget = $row
->get('widget/type');
if ($widget === 'inline_entity_form_single' || $widget === 'inline_entity_form') {
$target_bundles = $row
->get('target_bundles');
if (is_null($value['handler_settings']['target_bundles'])) {
$value['handler_settings']['target_bundles'] = $target_bundles;
}
}
}
return $value;
}
}