You are here

function uuid_link_entity_url in UUID Link 7

Same name and namespace in other branches
  1. 6 uuid_link.module \uuid_link_entity_url()

Get URL to an entity.

Parameters

$entity_type: Entity type.

$entity: Entity object.

1 call to uuid_link_entity_url()
uuid_link_tokens in ./uuid_link.module
Implements hook_tokens().

File

./uuid_link.module, line 232
Provides a filter and UI for adding links to entities that are not affected by changes in URL alias.

Code

function uuid_link_entity_url($entity_type, $entity) {
  switch ($entity_type) {
    default:
      $uri = entity_uri($entity_type, $entity);
      if (is_array($uri)) {
        return _uuid_link_entity_url($uri, $entity);
      }
    case 'file':
      return file_create_url($entity->uri);
  }
}