You are here

abstract class CckBuilder in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/migrate_drupal/src/Plugin/migrate/builder/CckBuilder.php \Drupal\migrate_drupal\Plugin\migrate\builder\CckBuilder

Base class for builders which leverage cckfield plugins.

Hierarchy

Expanded class hierarchy of CckBuilder

3 files declare their use of CckBuilder
CckMigration.php in core/modules/migrate_drupal/src/Plugin/migrate/builder/d6/CckMigration.php
Contains \Drupal\migrate_drupal\Plugin\migrate\builder\d6\CckMigration.
Node.php in core/modules/node/src/Plugin/migrate/builder/d6/Node.php
Contains \Drupal\node\Plugin\migrate\builder\d6\Node.
Node.php in core/modules/node/src/Plugin/migrate/builder/d7/Node.php
Contains \Drupal\node\Plugin\migrate\builder\d7\Node.

File

core/modules/migrate_drupal/src/Plugin/migrate/builder/CckBuilder.php, line 19
Contains \Drupal\migrate_drupal\Plugin\migrate\builder\CckBuilder.

Namespace

Drupal\migrate_drupal\Plugin\migrate\builder
View source
abstract class CckBuilder extends BuilderBase implements ContainerFactoryPluginInterface {

  /**
   * The cckfield plugin manager.
   *
   * @var \Drupal\migrate\Plugin\MigratePluginManager
   */
  protected $cckPluginManager;

  /**
   * Already-instantiated cckfield plugins, keyed by ID.
   *
   * @var \Drupal\migrate_drupal\Plugin\MigrateCckFieldInterface[]
   */
  protected $cckPluginCache = [];

  /**
   * Constructs a CckBuilder.
   *
   * @param array $configuration
   *   Plugin configuration.
   * @param string $plugin_id
   *   The plugin ID.
   * @param mixed $plugin_definition
   *   The plugin definition.
   * @param \Drupal\migrate\Plugin\MigratePluginManager $cck_manager
   *   The cckfield plugin manager.
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, MigratePluginManager $cck_manager) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->cckPluginManager = $cck_manager;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static($configuration, $plugin_id, $plugin_definition, $container
      ->get('plugin.manager.migrate.cckfield'));
  }

  /**
   * Gets a cckfield plugin instance.
   *
   * @param string $field_type
   *   The field type (plugin ID).
   * @param \Drupal\migrate\Entity\MigrationInterface|NULL $migration
   *   The migration, if any.
   *
   * @return \Drupal\migrate_drupal\Plugin\MigrateCckFieldInterface
   *   The cckfield plugin instance.
   */
  protected function getCckPlugin($field_type, MigrationInterface $migration = NULL) {
    if (empty($this->cckPluginCache[$field_type])) {
      $this->cckPluginCache[$field_type] = $this->cckPluginManager
        ->createInstance($field_type, [], $migration);
    }
    return $this->cckPluginCache[$field_type];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BuilderBase::getSourcePlugin protected function Returns a fully initialized instance of a source plugin.
CckBuilder::$cckPluginCache protected property Already-instantiated cckfield plugins, keyed by ID.
CckBuilder::$cckPluginManager protected property The cckfield plugin manager.
CckBuilder::create public static function Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface::create
CckBuilder::getCckPlugin protected function Gets a cckfield plugin instance.
CckBuilder::__construct public function Constructs a CckBuilder. Overrides PluginBase::__construct
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
MigrateBuilderInterface::buildMigrations public function Builds migration entities based on a template. 6
PluginBase::$configuration protected property Configuration information passed into the plugin. 2
PluginBase::$pluginDefinition protected property The plugin implementation definition.
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
StringTranslationTrait::$stringTranslation protected property The string translation service.
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.