function FieldDiscovery::getCoreVersion
Finds the core version of a Drupal migration.
Parameters
\Drupal\migrate\Plugin\MigrationInterface $migration: The migration.
Return value
string|bool A string representation of the Drupal version, or FALSE.
Throws
\InvalidArgumentException
5 calls to FieldDiscovery::getCoreVersion()
- FieldDiscovery::addAllFieldProcesses in core/
modules/ migrate_drupal/ src/ FieldDiscovery.php  - Adds the field processes to a migration.
 - FieldDiscovery::addBundleFieldProcesses in core/
modules/ migrate_drupal/ src/ FieldDiscovery.php  - Adds the field processes for a bundle to a migration.
 - FieldDiscovery::addEntityFieldProcesses in core/
modules/ migrate_drupal/ src/ FieldDiscovery.php  - Adds the field processes for an entity to a migration.
 - FieldDiscovery::getFieldPlugin in core/
modules/ migrate_drupal/ src/ FieldDiscovery.php  - Returns the appropriate field plugin for a given field type.
 - FieldDiscoveryTestClass::getCoreVersion in core/
modules/ migrate_drupal/ tests/ modules/ field_discovery_test/ src/ FieldDiscoveryTestClass.php  - Finds the core version of a Drupal migration.
 
1 method overrides FieldDiscovery::getCoreVersion()
- FieldDiscoveryTestClass::getCoreVersion in core/
modules/ migrate_drupal/ tests/ modules/ field_discovery_test/ src/ FieldDiscoveryTestClass.php  - Finds the core version of a Drupal migration.
 
File
- 
              core/
modules/ migrate_drupal/ src/ FieldDiscovery.php, line 333  
Class
- FieldDiscovery
 - Provides field discovery for Drupal 6 & 7 migrations.
 
Namespace
Drupal\migrate_drupalCode
protected function getCoreVersion(MigrationInterface $migration) {
  $tags = $migration->getMigrationTags();
  if (in_array('Drupal 7', $tags, TRUE)) {
    return FieldDiscoveryInterface::DRUPAL_7;
  }
  elseif (in_array('Drupal 6', $tags, TRUE)) {
    return FieldDiscoveryInterface::DRUPAL_6;
  }
  throw new \InvalidArgumentException("Drupal Core version not found for this migration");
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.