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/d7/Node.php \Drupal\node\Plugin\migrate\builder\d7\Node

Plugin annotation

@PluginID("d7_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/d7/Node.php, line 16
Contains \Drupal\node\Plugin\migrate\builder\d7\Node.

Namespace

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

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

    // Read all field instance definitions in the source database.
    $fields = array();
    foreach ($this
      ->getSourcePlugin('d7_field_instance', $template['source']) as $field) {
      $info = $field
        ->getSource();
      $fields[$info['entity_type']][$info['bundle']][$info['field_name']] = $info;
    }
    foreach ($this
      ->getSourcePlugin('d7_node_type', $template['source']) as $node_type) {
      $bundle = $node_type
        ->getSourceProperty('type');
      $values = $template;
      $values['id'] .= '__' . $bundle;
      $values['label'] = $this
        ->t('@label (@type)', [
        '@label' => $values['label'],
        '@type' => $node_type
          ->getSourceProperty('name'),
      ]);
      $values['source']['node_type'] = $bundle;
      $migration = Migration::create($values);
      if (isset($fields['node'][$bundle])) {
        foreach ($fields['node'][$bundle] as $field => $data) {
          if ($this->cckPluginManager
            ->hasDefinition($data['type'])) {
            $this
              ->getCckPlugin($data['type'])
              ->processCckFieldValues($migration, $field, $data);
          }
          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.