You are here

function path_delete in Redis 7.3

Same name and namespace in other branches
  1. 7.2 redis.path.inc \path_delete()

Delete a URL alias.

Parameters

$criteria: A number representing the pid or an array of criteria.

File

./redis.path.inc, line 469
Drupal default includes/path.inc file copy which only differs in:

Code

function path_delete($criteria) {
  if (!is_array($criteria)) {
    $criteria = array(
      'pid' => $criteria,
    );
  }
  $path = path_load($criteria);
  $query = db_delete('url_alias');
  foreach ($criteria as $field => $value) {
    $query
      ->condition($field, $value);
  }
  $query
    ->execute();
  module_invoke_all('path_delete', $path);
  redis_path_backend_get()
    ->deleteAlias($path['source'], $path['alias'], $path['language']);
  drupal_clear_path_cache($path['source']);
}