You are here

function domain_path_path_load in Domain Path 7

Fetch a specific domain path alias from the database.

Parameters

$conditions: A string representing the source, a number representing the dpid, or an array of query conditions.

Return value

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

  • source: The internal system path.
  • alias: The URL alias.
  • dpid: Unique path alias identifier.
  • domain_id: The domain ID.
  • entity_type: The entity type.
  • entity_id: The entity ID.
  • language: The language of the alias.
3 calls to domain_path_path_load()
domain_path_node_insert in ./domain_path.module
Implements hook_node_insert().
domain_path_path_delete in ./domain_path.module
Delete a domain path alias.
domain_path_path_save in ./domain_path.module
Save a domain path alias to the database.

File

./domain_path.module, line 36
Path alias handling for multiple domains.

Code

function domain_path_path_load($conditions) {
  global $_domain;
  if (is_numeric($conditions)) {
    $conditions = array(
      'dpid' => $conditions,
    );
  }
  elseif (is_string($conditions)) {
    $conditions = array(
      'source' => $conditions,
    );
  }
  elseif (!is_array($conditions)) {
    return FALSE;
  }
  if (empty($conditions['domain_id'])) {
    $conditions['domain_id'] = $_domain['domain_id'];
  }
  $select = db_select('domain_path');
  foreach ($conditions as $field => $value) {
    $select
      ->condition($field, $value);
  }
  return $select
    ->fields('domain_path')
    ->execute()
    ->fetchAssoc();
}