You are here

function domain_path_path_delete in Domain Path 7

Delete a domain path alias.

Parameters

$criteria: A number representing the dpid or an array of criteria. (Must contain domain_id if dpid is not set.)

1 call to domain_path_path_delete()
domain_path_node_insert in ./domain_path.module
Implements hook_node_insert().

File

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

Code

function domain_path_path_delete($criteria) {
  if (!is_array($criteria)) {
    $criteria = array(
      'dpid' => $criteria,
    );
  }
  elseif (empty($criteria['domain_id'])) {
    return;

    // Should we put in a watchdog error?
  }
  $path = domain_path_path_load($criteria);
  $query = db_delete('domain_path');
  foreach ($criteria as $field => $value) {
    $query
      ->condition($field, $value);
  }
  $query
    ->execute();
  module_invoke_all('domain_path_delete', $path);
}