public function MigrateSQLMap::getRowByDestination in Migrate 7.2
Same name and namespace in other branches
- 6.2 plugins/sources/sqlmap.inc \MigrateSQLMap::getRowByDestination()
Retrieve a row from the map table, given a destination ID.
Parameters
array $source_id:
Overrides MigrateMap::getRowByDestination
File
- plugins/
sources/ sqlmap.inc, line 288 - Defines a Drupal db-based implementation of MigrateMap.
Class
- MigrateSQLMap
- @file Defines a Drupal db-based implementation of MigrateMap.
Code
public function getRowByDestination(array $destination_id) {
migrate_instrument_start('getRowByDestination');
$query = $this->connection
->select($this->mapTable, 'map')
->fields('map');
foreach ($this->destinationKeyMap as $key_name) {
$query = $query
->condition("map.{$key_name}", array_shift($destination_id), '=');
}
$result = $query
->execute();
migrate_instrument_stop('getRowByDestination');
return $result
->fetchAssoc();
}