Namespace
Drupal\color_field\Plugin\migrate\field
Fichier
-
src/Plugin/migrate/field/ColorField.php
View source
<?php
declare (strict_types=1);
namespace Drupal\color_field\Plugin\migrate\field;
use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate_drupal\Plugin\migrate\field\FieldPluginBase;
class ColorField extends FieldPluginBase {
public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) {
$process = [
'plugin' => 'sub_process',
'source' => $field_name,
'process' => [
'color' => 'rgb',
'opacity' => 'opacity',
],
];
$migration->setProcessOfProperty($field_name, $process);
}
public function getFieldWidgetMap() : array {
return [
'color_field_default_widget' => 'color_field_widget_box',
'color_field_simple_widget' => 'color_field_widget_grid',
'color_field_spectrum_widget' => 'color_field_widget_html5',
'color_field_plain_text' => 'color_field_widget_default',
];
}
public function getFieldFormatterMap() : array {
return [
'color_field_default_formatter' => 'color_field_formatter_text',
'color_field_css_declaration' => 'color_field_formatter_css',
'color_field_swatch' => 'color_field_formatter_swatch',
];
}
}
Classes
| Titre |
Deprecated |
Résumé |
| ColorField |
|
Field Plugin for color field migrations. |