RelationLinkManager::getRelations

protected RelationLinkManager::getRelations($context = array())

Get the array of relation links.

Any field can be handled as a relation simply by changing how it is normalized. Therefore, there is no prior knowledge that can be used here to determine which fields to assign relation URIs. Instead, each field, even primitives, are given a relation URI. It is up to the caller to determine which URIs to use.

Parameters

array $context: Context from the normalizer/serializer operation.

Return value

array An array of typed data ids (entity_type, bundle, and field name) keyed by corresponding relation URI.

File

core/modules/rest/src/LinkManager/RelationLinkManager.php, line 104

Class

RelationLinkManager

Namespace

Drupal\rest\LinkManager

Code

protected function getRelations($context = array()) {
  $cid = 'rest:links:relations';
  $cache = $this->cache->get($cid);
  if (!$cache) {
    $this->writeCache($context);
    $cache = $this->cache->get($cid);
  }
  return $cache->data;
}
doc_Drupal
2016-10-29 09:37:22
Comments
Leave a Comment

Please login to continue.