You are here

public function RelationLinkManager::getRelationUri in Default Content 8

Gets the URI that corresponds to a field.

When using hypermedia formats, this URI can be used to indicate which field the data represents. Documentation about this field can also be provided at this URI.

Parameters

string $entity_type: The bundle's entity type.

string $bundle: The bundle name.

string $field_name: The field name.

array $context: (optional) Optional serializer/normalizer context.

Return value

string The corresponding URI (or IANA link relation type) for the field.

Overrides RelationLinkManager::getRelationUri

1 call to RelationLinkManager::getRelationUri()
RelationLinkManager::writeCache in src/LinkManager/RelationLinkManager.php
Writes the cache of relation links.

File

src/LinkManager/RelationLinkManager.php, line 18
Contains \Drupal\defaultcontent\LinkManager\RelationLinkManager.

Class

RelationLinkManager

Namespace

Drupal\defaultcontent\LinkManager

Code

public function getRelationUri($entity_type, $bundle, $field_name) {

  // Make the base path refer to drupal.org.x`
  return "http://drupal.org/rest/relation/{$entity_type}/{$bundle}/{$field_name}";
}