protected function MigrateToolsCommands::getMigrationRequirements in Migrate Tools 8.5
Returns the migration requirements for the provided migration.
Parameters
\Drupal\migrate\Plugin\MigrationInterface $migration: The migration instance.
Return value
array Array of migration requirements.
Throws
\ReflectionException
1 call to MigrateToolsCommands::getMigrationRequirements()
- MigrateToolsCommands::executeMigration in src/
Commands/ MigrateToolsCommands.php - Executes a single migration.
File
- src/
Commands/ MigrateToolsCommands.php, line 1007
Class
- MigrateToolsCommands
- Migrate Tools drush commands.
Namespace
Drupal\migrate_tools\CommandsCode
protected function getMigrationRequirements(MigrationInterface $migration) {
if (method_exists($migration, 'getRequirements')) {
// Use the getRequirements method on Drupal 9.1.x and newer.
return $migration
->getRequirements();
}
// FIXME: Don't use reflection.
// @see https://www.drupal.org/project/migrate_tools/issues/3117485
// Maintain Drupal 8.x and 9.0.x compatibility using Reflection until an appropriate
// interface method or reimplementation is available.
$reflection = new \ReflectionClass($migration);
$property = $reflection
->getProperty('requirements');
$property
->setAccessible(TRUE);
return $property
->getValue($migration);
}