public function DrupalVersion7::getPath in Drupal-to-Drupal data migration 7.2
Given a source path (e.g, 'node/123'), return the first alias for that path.
Parameters
$source:
Return value
string
Overrides DrupalVersion::getPath
File
- d7/
d7.inc, line 46 - Implementation of DrupalVersion for Drupal 7 sources.
Class
- DrupalVersion7
- @file Implementation of DrupalVersion for Drupal 7 sources.
Code
public function getPath($source) {
if (Database::getConnection('default', $this->arguments['source_connection'])
->schema()
->tableExists('url_alias')) {
$path = Database::getConnection('default', $this->arguments['source_connection'])
->select('url_alias', 'ua')
->fields('ua', array(
'alias',
))
->condition('source', $source)
->orderBy('pid', 'DESC')
->execute()
->fetchField();
}
else {
$path = $source;
}
return $path;
}