class CckMigration in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/migrate_drupal/src/Plugin/migrate/builder/d6/CckMigration.php \Drupal\migrate_drupal\Plugin\migrate\builder\d6\CckMigration
 
Plugin annotation
@PluginID("d6_cck_migration");
  Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, StringTranslationTrait
- class \Drupal\migrate\Plugin\migrate\builder\BuilderBase implements MigrateBuilderInterface
- class \Drupal\migrate_drupal\Plugin\migrate\builder\CckBuilder implements ContainerFactoryPluginInterface
- class \Drupal\migrate_drupal\Plugin\migrate\builder\d6\CckMigration
 
 
 - class \Drupal\migrate_drupal\Plugin\migrate\builder\CckBuilder implements ContainerFactoryPluginInterface
 
 - class \Drupal\migrate\Plugin\migrate\builder\BuilderBase implements MigrateBuilderInterface
 
 - class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, StringTranslationTrait
 
Expanded class hierarchy of CckMigration
File
- core/
modules/ migrate_drupal/ src/ Plugin/ migrate/ builder/ d6/ CckMigration.php, line 18  - Contains \Drupal\migrate_drupal\Plugin\migrate\builder\d6\CckMigration.
 
Namespace
Drupal\migrate_drupal\Plugin\migrate\builder\d6View source
class CckMigration extends CckBuilder {
  /**
   * List of cckfield plugin IDs which have already run.
   *
   * @var string[]
   */
  protected $processedFieldTypes = [];
  /**
   * {@inheritdoc}
   */
  public function buildMigrations(array $template) {
    $migration = Migration::create($template);
    $source_plugin = $migration
      ->getSourcePlugin();
    // The source plugin will throw RequirementsException if CCK is not enabled,
    // in which case there is nothing else for us to do.
    if ($source_plugin instanceof RequirementsInterface) {
      try {
        $source_plugin
          ->checkRequirements();
      } catch (RequirementsException $e) {
        return [
          $migration,
        ];
      }
    }
    // Loop through every field that will be migrated.
    foreach ($source_plugin as $field) {
      $field_type = $field
        ->getSourceProperty('type');
      // Each field type should only be processed once.
      if (in_array($field_type, $this->processedFieldTypes)) {
        continue;
      }
      elseif ($this->cckPluginManager
        ->hasDefinition($field_type)) {
        $this->processedFieldTypes[] = $field_type;
        // Allow the cckfield plugin to alter the migration as necessary so that
        // it knows how to handle fields of this type.
        $this->cckPluginManager
          ->createInstance($field_type, [], $migration)
          ->{$this->configuration['cck_plugin_method']}($migration);
      }
    }
    return [
      $migration,
    ];
  }
}Members
| 
            Name | 
                  Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| 
            BuilderBase:: | 
                  protected | function | Returns a fully initialized instance of a source plugin. | |
| 
            CckBuilder:: | 
                  protected | property | Already-instantiated cckfield plugins, keyed by ID. | |
| 
            CckBuilder:: | 
                  protected | property | The cckfield plugin manager. | |
| 
            CckBuilder:: | 
                  public static | function | 
            Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: | 
                  |
| 
            CckBuilder:: | 
                  protected | function | Gets a cckfield plugin instance. | |
| 
            CckBuilder:: | 
                  public | function | 
            Constructs a CckBuilder. Overrides PluginBase:: | 
                  |
| 
            CckMigration:: | 
                  protected | property | List of cckfield plugin IDs which have already run. | |
| 
            CckMigration:: | 
                  public | function | 
            Builds migration entities based on a template. Overrides MigrateBuilderInterface:: | 
                  |
| 
            DependencySerializationTrait:: | 
                  protected | property | An array of service IDs keyed by property name used for serialization. | |
| 
            DependencySerializationTrait:: | 
                  public | function | 1 | |
| 
            DependencySerializationTrait:: | 
                  public | function | 2 | |
| 
            PluginBase:: | 
                  protected | property | Configuration information passed into the plugin. | 2 | 
| 
            PluginBase:: | 
                  protected | property | The plugin implementation definition. | |
| 
            PluginBase:: | 
                  protected | property | The plugin_id. | |
| 
            PluginBase:: | 
                  constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
| 
            PluginBase:: | 
                  public | function | 
            Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: | 
                  |
| 
            PluginBase:: | 
                  public | function | 
            Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: | 
                  |
| 
            PluginBase:: | 
                  public | function | 
            Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: | 
                  |
| 
            PluginBase:: | 
                  public | function | 
            Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: | 
                  |
| 
            StringTranslationTrait:: | 
                  protected | property | The string translation service. | |
| 
            StringTranslationTrait:: | 
                  protected | function | Formats a string containing a count of items. | |
| 
            StringTranslationTrait:: | 
                  protected | function | Returns the number of plurals supported by a given language. | |
| 
            StringTranslationTrait:: | 
                  protected | function | Gets the string translation service. | |
| 
            StringTranslationTrait:: | 
                  public | function | Sets the string translation service to use. | 2 | 
| 
            StringTranslationTrait:: | 
                  protected | function | Translates a string to the current language or to a given language. |