
| Current Path : /var/www/html/rocksensor/vendor/drush/drush/src/Drupal/Migrate/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/rocksensor/vendor/drush/drush/src/Drupal/Migrate/MigrateRunnerServiceProvider.php |
<?php
namespace Drush\Drupal\Migrate;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceModifierInterface;
use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;
/**
* Registers a new migrate_prepare_row hook implementation.
*
* A new 'migrate_prepare_row' hook implementation in behalf of the system.
*
* @todo Deprecate this hook implementation when #2952291 lands.
* @see https://www.drupal.org/project/drupal/issues/2952291
*/
class MigrateRunnerServiceProvider implements ServiceModifierInterface
{
/**
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container): void
{
$modules = $container->hasParameter('container.modules') ? $container->getParameter('container.modules') : [];
if (!isset($modules['migrate'])) {
return;
}
if (!$container->hasParameter('hook_implementations_map')) {
return;
}
$map = $container->getParameter('hook_implementations_map');
$hook = 'migrate_prepare_row';
$class = MigrateRunnerHooks::class;
$method = 'prepareRow';
$container->register($class, $class)
->addTag('kernel.event_listener', [
'event' => 'drupal_hook.' . $hook,
'method' => $method,
'priority' => 0,
])->setAutowired(true);
$map[$hook][$class][$method] = 'system';
$container->setParameter('hook_implementations_map', $map);
}
}