function MenuLinkParent::__construct

Same name and namespace in other branches
  1. 9 core/modules/migrate/src/Plugin/migrate/process/MenuLinkParent.php \Drupal\migrate\Plugin\migrate\process\MenuLinkParent::__construct()
  2. 10 core/modules/migrate/src/Plugin/migrate/process/MenuLinkParent.php \Drupal\migrate\Plugin\migrate\process\MenuLinkParent::__construct()
  3. 11.x core/modules/migrate/src/Plugin/migrate/process/MenuLinkParent.php \Drupal\migrate\Plugin\migrate\process\MenuLinkParent::__construct()

Constructs a MenuLinkParent object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\migrate\MigrateLookupInterface $migrate_lookup: The migrate lookup service.

\Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager: The menu link manager.

\Drupal\Core\Entity\EntityStorageInterface $menu_link_storage: The menu link storage object.

\Drupal\migrate\Plugin\MigrationInterface $migration: The currently running migration.

Overrides PluginBase::__construct

File

core/modules/migrate/src/Plugin/migrate/process/MenuLinkParent.php, line 83

Class

MenuLinkParent
This plugin figures out menu link parent plugin IDs.

Namespace

Drupal\migrate\Plugin\migrate\process

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, $migrate_lookup, MenuLinkManagerInterface $menu_link_manager, EntityStorageInterface $menu_link_storage, MigrationInterface $migration = NULL) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  if ($migrate_lookup instanceof MigrateProcessInterface) {
    @trigger_error('Passing a migration process plugin as the fourth argument to ' . __METHOD__ . ' is deprecated in drupal:8.8.0 and will throw an error in drupal:9.0.0. Pass the migrate.lookup service instead. See https://www.drupal.org/node/3047268', E_USER_DEPRECATED);
    $this->migrationPlugin = $migrate_lookup;
    $migrate_lookup = \Drupal::service('migrate.lookup');
  }
  elseif (!$migrate_lookup instanceof MigrateLookupInterface) {
    throw new \InvalidArgumentException("The fourth argument to " . __METHOD__ . " must be an instance of MigrateLookupInterface.");
  }
  elseif (!$migration instanceof MigrationInterface) {
    throw new \InvalidArgumentException("The seventh argument to " . __METHOD__ . " must be an instance of MigrationInterface.");
  }
  $this->migration = $migration;
  $this->migrateLookup = $migrate_lookup;
  $this->menuLinkManager = $menu_link_manager;
  $this->menuLinkStorage = $menu_link_storage;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.