You are here

function redirect_load_by_hash in Redirect 7

Same name and namespace in other branches
  1. 7.2 redirect.module \redirect_load_by_hash()

Load an URL redirect from the database by {redirect}.hash.

Parameters

$hash: The hash of the URL redirect.

$reset: Whether to reset the redirect_load_multiple cache.

Return value

An URL redirect object, or FALSE if loading failed.

Related topics

7 calls to redirect_load_by_hash()
drush_redirect_create_redirect in ./redirect.drush.inc
Command callback. Validates and adds a redirect.
MigrateRedirectEntityHandler::redirectValidate in ./redirect.migrate.inc
Validates a redirect.
redirect_path_delete in ./redirect.module
Implements hook_path_delete().
redirect_path_update in ./redirect.module
Implements hook_path_update().
redirect_save in ./redirect.module
Save an URL redirect.

... See full list

File

./redirect.module, line 562

Code

function redirect_load_by_hash($hash, $reset = FALSE) {
  $redirects = entity_load('redirect', FALSE, array(
    'hash' => $hash,
  ), $reset);
  return !empty($redirects) ? reset($redirects) : FALSE;
}