Drupal 8  8.0.2
RelationLinkManager Class Reference
Inheritance diagram for RelationLinkManager:

Public Member Functions

 __construct (CacheBackendInterface $cache, EntityManagerInterface $entity_manager, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory, RequestStack $request_stack)
 
 getRelationUri ($entity_type, $bundle, $field_name, $context=array())
 
 getRelationInternalIds ($relation_uri, $context=array())
 

Protected Member Functions

 getRelations ($context=array())
 
 writeCache ($context=array())
 

Protected Attributes

 $cache
 
 $entityManager
 
 $moduleHandler
 

Constructor & Destructor Documentation

__construct ( CacheBackendInterface  $cache,
EntityManagerInterface  $entity_manager,
ModuleHandlerInterface  $module_handler,
ConfigFactoryInterface  $config_factory,
RequestStack  $request_stack 
)

Constructor.

Parameters
\Drupal\Core\Cache\CacheBackendInterface$cacheThe cache of relation URIs and their associated Typed Data IDs.
\Drupal\Core\Entity\EntityManagerInterface$entity_managerThe entity manager.
\Drupal\Core\Extension\ModuleHandlerInterface$module_handlerThe module handler service.
\Drupal\Core\Config\ConfigFactoryInterface$config_factoryThe config factory service.
\Symfony\Component\HttpFoundation\RequestStack$request_stackThe request stack.

References Drupal\cache(), Drupal\configFactory(), Drupal\entityManager(), Drupal\moduleHandler(), and Drupal\requestStack().

Here is the call graph for this function:

Member Function Documentation

getRelationInternalIds (   $relation_uri,
  $context = array() 
)

{}

References RelationLinkManager\getRelations().

Here is the call graph for this function:

getRelations (   $context = array())
protected

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$contextContext from the normalizer/serializer operation.
Returns
array An array of typed data ids (entity_type, bundle, and field name) keyed by corresponding relation URI.

References Drupal\cache(), and RelationLinkManager\writeCache().

Referenced by RelationLinkManager\getRelationInternalIds().

Here is the call graph for this function:

Here is the caller graph for this function:

getRelationUri (   $entity_type,
  $bundle,
  $field_name,
  $context = array() 
)

{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_typeThe bundle's entity type.
string$bundleThe bundle name.
string$field_nameThe field name.
array$context(optional) Optional serializer/normalizer context.
Returns
string The corresponding URI for the field.
}

Implements RelationLinkManagerInterface.

References LinkManagerBase\getLinkDomain(), and Drupal\moduleHandler().

Referenced by RelationLinkManager\writeCache().

Here is the call graph for this function:

Here is the caller graph for this function:

writeCache (   $context = array())
protected

Writes the cache of relation links.

Parameters
array$contextContext from the normalizer/serializer operation.

References Drupal\cache(), Drupal\entityManager(), RelationLinkManager\getRelationUri(), and Cache\PERMANENT.

Referenced by RelationLinkManager\getRelations().

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file: