function BlockVisibility::__construct

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

File

core/modules/block/src/Plugin/migrate/process/BlockVisibility.php, line 75

Class

BlockVisibility
Plugin annotation @MigrateProcessPlugin( id = "block_visibility" )

Namespace

Drupal\block\Plugin\migrate\process

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, ModuleHandlerInterface $module_handler, $migrate_lookup) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    if ($migrate_lookup instanceof MigrateProcessInterface) {
        @trigger_error('Passing a migration process plugin as the fifth 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 fifth argument to " . __METHOD__ . " must be an instance of MigrateLookupInterface.");
    }
    $this->moduleHandler = $module_handler;
    $this->migrateLookup = $migrate_lookup;
    if (isset($configuration['skip_php'])) {
        $this->skipPHP = $configuration['skip_php'];
    }
}

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