You are here

function path_entity_translation_delete in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/path/path.module \path_entity_translation_delete()

Implements hook_entity_translation_delete().

File

core/modules/path/path.module, line 85
Enables users to rename URLs.

Code

function path_entity_translation_delete(EntityInterface $translation) {
  $path = $translation
    ->urlInfo()
    ->getInternalPath();
  $conditions = array(
    'source' => '/' . $path,
    'langcode' => $translation
      ->language()
      ->getId(),
  );
  \Drupal::service('path.alias_storage')
    ->delete($conditions);
}