You are here

private function EntityManager::getResourceUrl in Acquia Content Hub 8

Returns the local Resource URL.

This is an absolute URL, which base_url can be overwritten with the variable 'acquia_contenthub_rewrite_localdomain', which is especially useful in cases where the Content Hub module is installed in a Drupal site that is running locally (not from the public internet).

Return value

string|bool The absolute resource URL, if it can be generated, FALSE otherwise.

1 call to EntityManager::getResourceUrl()
EntityManager::deleteRemoteEntity in src/EntityManager.php
Delete an entity from Content Hub.

File

src/EntityManager.php, line 440

Class

EntityManager
Provides a service for managing entity actions for Content Hub.

Namespace

Drupal\acquia_contenthub

Code

private function getResourceUrl(EntityInterface $entity, $include_references = 'true') {

  // Check if there are link templates defined for the entity type and
  // use the path from the route instead of the default.
  $entity_type_id = $entity
    ->getEntityTypeId();
  $route_name = 'acquia_contenthub.entity.' . $entity_type_id . '.GET.acquia_contenthub_cdf';
  $url_options = [
    'entity_type' => $entity_type_id,
    $entity_type_id => $entity
      ->id(),
    '_format' => 'acquia_contenthub_cdf',
    'include_references' => $include_references,
  ];
  return $this
    ->getResourceUrlByRouteName($route_name, $url_options);
}