1 path.module path_delete_all_by_entity(Entity $entity, $default_uri = NULL)

Delete an entity URL alias and any of its sub-paths.

This function also checks to see if the default entity URI is different from the current entity URI and will delete any of the default aliases.

Parameters

Entity $entity: An entity object.

$default_uri: The optional default uri path for the entity.

File

core/modules/path/path.module, line 780
Enables users to customize URLs and provide automatic URL alias patterns.

Code

function path_delete_all_by_entity(Entity $entity, $default_uri = NULL) {
  $uri = $entity->uri();

  if (!empty($uri)) {
    path_delete_all_by_source($uri['path']);
    if (isset($default_uri) && $uri['path'] != $default_uri) {
      path_delete_all_by_source($default_uri);
    }
  }
}