CckFieldPluginBase.php in Zircon Profile 8.0
File
core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php
View source
<?php
namespace Drupal\migrate_drupal\Plugin\migrate\cckfield;
use Drupal\Core\Plugin\PluginBase;
use Drupal\migrate\Entity\MigrationInterface;
use Drupal\migrate\Row;
use Drupal\migrate_drupal\Plugin\MigrateCckFieldInterface;
abstract class CckFieldPluginBase extends PluginBase implements MigrateCckFieldInterface {
public function processField(MigrationInterface $migration) {
$process[0]['map'][$this->pluginId][$this->pluginId] = $this->pluginId;
$migration
->mergeProcessOfProperty('type', $process);
}
public function processFieldInstance(MigrationInterface $migration) {
}
public function processFieldWidget(MigrationInterface $migration) {
$process = [];
foreach ($this
->getFieldWidgetMap() as $source_widget => $destination_widget) {
$process['type']['map'][$source_widget] = $destination_widget;
}
$migration
->mergeProcessOfProperty('options/type', $process);
}
public function getFieldWidgetMap() {
return [
$this->pluginId => $this->pluginId . '_default',
];
}
public function processFieldFormatter(MigrationInterface $migration) {
$process = [];
foreach ($this
->getFieldFormatterMap() as $source_format => $destination_format) {
$process[0]['map'][$this->pluginId][$source_format] = $destination_format;
}
$migration
->mergeProcessOfProperty('options/type', $process);
}
public function getFieldType(Row $row) {
$field_type = $row
->getSourceProperty('type');
if (isset($this->pluginDefinition['type_map'][$field_type])) {
return $this->pluginDefinition['type_map'][$field_type];
}
else {
return $field_type;
}
}
}