You are here

function _pathauto_existing_alias_data in Pathauto 6

Same name and namespace in other branches
  1. 5.2 pathauto.inc \_pathauto_existing_alias_data()
  2. 6.2 pathauto.inc \_pathauto_existing_alias_data()
  3. 7 pathauto.inc \_pathauto_existing_alias_data()

Fetches an existing URL alias given a path and optional language.

Parameters

$source: An internal Drupal path.

$language: An optional language code to look up the path in.

Return value

FALSE if no alias was found or an associative array containing the following keys:

  • pid: Unique path alias identifier.
  • alias: The URL alias.
1 call to _pathauto_existing_alias_data()
pathauto_create_alias in ./pathauto.inc
Apply patterns to create an alias.

File

./pathauto.inc, line 54
Miscellaneous functions for Pathauto.

Code

function _pathauto_existing_alias_data($source, $language = '') {
  return db_fetch_array(db_query_range("SELECT pid, dst AS alias, language FROM {url_alias} WHERE src = '%s' AND language IN ('%s', '') ORDER BY language DESC, pid DESC", $source, $language, 0, 1));
}