Update to Drupal 8.0.0-rc3. For more information, see https://www.drupal.org/node/2608078
This commit is contained in:
parent
6419a031d7
commit
4afb23bbd3
762 changed files with 20080 additions and 6368 deletions
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\migrate_drupal\Annotation\MigrateCckField.
|
||||
*/
|
||||
|
||||
namespace Drupal\migrate_drupal\Annotation;
|
||||
|
||||
use Drupal\Component\Annotation\Plugin;
|
||||
|
||||
/**
|
||||
* Defines a cckfield plugin annotation object.
|
||||
*
|
||||
* cckfield plugins are variously responsible for handling the migration of
|
||||
* CCK fields from Drupal 6 to Drupal 8. They are allowed to alter CCK-related
|
||||
* migrations when migrations are being generated, and can compute destination
|
||||
* field types for individual fields during the actual migration process.
|
||||
*
|
||||
* Plugin Namespace: Plugin\migrate\cckfield
|
||||
*
|
||||
* @Annotation
|
||||
*/
|
||||
class MigrateCckField extends Plugin {
|
||||
|
||||
/**
|
||||
* The plugin ID.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $id;
|
||||
|
||||
/**
|
||||
* Map of D6 and D7 field types to D8 field type plugin IDs.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $type_map = [];
|
||||
|
||||
}
|
|
@ -9,6 +9,7 @@ namespace Drupal\migrate_drupal\Plugin;
|
|||
|
||||
use Drupal\Component\Plugin\PluginInspectionInterface;
|
||||
use Drupal\migrate\Entity\MigrationInterface;
|
||||
use Drupal\migrate\Row;
|
||||
|
||||
/**
|
||||
* Provides an interface for all CCK field type plugins.
|
||||
|
@ -77,4 +78,15 @@ interface MigrateCckFieldInterface extends PluginInspectionInterface {
|
|||
*/
|
||||
public function processCckFieldValues(MigrationInterface $migration, $field_name, $data);
|
||||
|
||||
/**
|
||||
* Computes the destination type of a migrated field.
|
||||
*
|
||||
* @param \Drupal\migrate\Row $row
|
||||
* The field being migrated.
|
||||
*
|
||||
* @return string
|
||||
* The destination field type.
|
||||
*/
|
||||
public function getFieldType(Row $row);
|
||||
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ 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;
|
||||
|
||||
/**
|
||||
|
@ -70,4 +71,18 @@ abstract class CckFieldPluginBase extends PluginBase implements MigrateCckFieldI
|
|||
$migration->mergeProcessOfProperty('options/type', $process);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue