1 path.inc path_save_automatic_entity_alias(Entity $entity)

Update the URL aliases for an individual taxonomy term.

Parameters

Entity $entity: An entity (node/user/term/etc.) object.

Return value

array The path array saved into the database or FALSE if the path was not saved.

File

core/modules/path/path.inc, line 502
Miscellaneous functions for Path module.

Code

function path_save_automatic_entity_alias(Entity $entity) {
  $langcode = isset($entity->langcode) ? $entity->langcode : LANGUAGE_NONE;
  $uri = $entity->uri();
  $path = FALSE;
  if ($alias = path_generate_entity_alias($entity, $uri['path'], $langcode)) {
    $path = path_save_automatic_alias($uri['path'], $alias, $langcode);
  }

  return $path;
}