You are here

class Node in Zircon Profile 8

Same name in this branch
  1. 8 core/modules/node/src/Entity/Node.php \Drupal\node\Entity\Node
  2. 8 core/modules/node/src/Plugin/views/argument_default/Node.php \Drupal\node\Plugin\views\argument_default\Node
  3. 8 core/modules/node/src/Plugin/views/wizard/Node.php \Drupal\node\Plugin\views\wizard\Node
  4. 8 core/modules/node/src/Plugin/views/field/Node.php \Drupal\node\Plugin\views\field\Node
  5. 8 core/modules/node/src/Plugin/migrate/source/d6/Node.php \Drupal\node\Plugin\migrate\source\d6\Node
  6. 8 core/modules/node/src/Plugin/migrate/source/d7/Node.php \Drupal\node\Plugin\migrate\source\d7\Node
  7. 8 core/modules/node/src/Plugin/migrate/builder/d6/Node.php \Drupal\node\Plugin\migrate\builder\d6\Node
  8. 8 core/modules/node/src/Plugin/migrate/builder/d7/Node.php \Drupal\node\Plugin\migrate\builder\d7\Node
Same name and namespace in other branches
  1. 8.0 core/modules/node/src/Plugin/migrate/builder/d6/Node.php \Drupal\node\Plugin\migrate\builder\d6\Node

Plugin annotation

@PluginID("d6_node");

Hierarchy

Expanded class hierarchy of Node

12 string references to 'Node'
CategorizingPluginManagerTraitTest::setUp in core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php
CategorizingPluginManagerTraitTest::testProcessDefinitionCategory in core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php
@covers ::processDefinitionCategory
CategoryAutocompleteTest::providerTestAutocompleteSuggestions in core/modules/block/tests/src/Unit/CategoryAutocompleteTest.php
Data provider for testAutocompleteSuggestions().
CategoryAutocompleteTest::setUp in core/modules/block/tests/src/Unit/CategoryAutocompleteTest.php
CommentManagerTest::testGetFields in core/modules/comment/tests/src/Unit/CommentManagerTest.php
Tests the getFields method.

... See full list

File

core/modules/node/src/Plugin/migrate/builder/d6/Node.php, line 17
Contains \Drupal\node\Plugin\migrate\builder\d6\Node.

Namespace

Drupal\node\Plugin\migrate\builder\d6
View source
class Node extends CckBuilder {

  /**
   * {@inheritdoc}
   */
  public function buildMigrations(array $template) {
    $migrations = [];

    // Read all CCK field instance definitions in the source database.
    $fields = array();
    $source_plugin = $this
      ->getSourcePlugin('d6_field_instance', $template['source']);
    try {
      $source_plugin
        ->checkRequirements();
      foreach ($source_plugin as $field) {
        $info = $field
          ->getSource();
        $fields[$info['type_name']][$info['field_name']] = $info;
      }
    } catch (RequirementsException $e) {

      // Don't do anything; $fields will be empty.
    }
    foreach ($this
      ->getSourcePlugin('d6_node_type', $template['source']) as $row) {
      $node_type = $row
        ->getSourceProperty('type');
      $values = $template;
      $values['id'] = $template['id'] . '__' . $node_type;
      $label = $template['label'];
      $values['label'] = $this
        ->t("@label (@type)", [
        '@label' => $label,
        '@type' => $node_type,
      ]);
      $values['source']['node_type'] = $node_type;

      // If this migration is based on the d6_node_revision template, it should
      // explicitly depend on the corresponding d6_node variant.
      if ($template['id'] == 'd6_node_revision') {
        $values['migration_dependencies']['required'][] = 'd6_node__' . $node_type;
      }
      $migration = Migration::create($values);
      if (isset($fields[$node_type])) {
        foreach ($fields[$node_type] as $field => $info) {
          if ($this->cckPluginManager
            ->hasDefinition($info['type'])) {
            $this
              ->getCckPlugin($info['type'])
              ->processCckFieldValues($migration, $field, $info);
          }
          else {
            $migration
              ->setProcessOfProperty($field, $field);
          }
        }
      }
      $migrations[] = $migration;
    }
    return $migrations;
  }

}

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
Node::buildMigrations public function Builds migration entities based on a template. Overrides MigrateBuilderInterface::buildMigrations
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.