CckBuilder.php in Zircon Profile 8
File
core/modules/migrate_drupal/src/Plugin/migrate/builder/CckBuilder.php
View source
<?php
namespace Drupal\migrate_drupal\Plugin\migrate\builder;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\migrate\Entity\MigrationInterface;
use Drupal\migrate\Plugin\migrate\builder\BuilderBase;
use Drupal\migrate\Plugin\MigratePluginManager;
use Symfony\Component\DependencyInjection\ContainerInterface;
abstract class CckBuilder extends BuilderBase implements ContainerFactoryPluginInterface {
protected $cckPluginManager;
protected $cckPluginCache = [];
public function __construct(array $configuration, $plugin_id, $plugin_definition, MigratePluginManager $cck_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->cckPluginManager = $cck_manager;
}
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'));
}
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];
}
}
Classes
Name |
Description |
CckBuilder |
Base class for builders which leverage cckfield plugins. |