RelationLinkManager
class RelationLinkManager extends LinkManagerBase implements RelationLinkManagerInterface (View source)
Properties
| protected string | $linkDomain | Link domain used for type links URIs. |
from LinkManagerBase |
| protected ConfigFactoryInterface | $configFactory | Config factory service. |
from LinkManagerBase |
| protected RequestStack | $requestStack | The request stack. |
from LinkManagerBase |
| protected CacheBackendInterface | $cache | ||
| protected EntityFieldManagerInterface | $entityFieldManager | The entity field manager. |
|
| protected EntityTypeBundleInfoInterface | $entityTypeBundleInfo | The entity bundle info. |
|
| protected EntityTypeManagerInterface | $entityTypeManager | The entity type manager. |
|
| protected ModuleHandlerInterface | $moduleHandler | Module handler service. |
Methods
Constructor.
Gets the URI that corresponds to a field.
Translates a REST URI into internal IDs.
Get the array of relation links.
Writes the cache of relation links.
Details
setLinkDomain($domain)
{@inheritdoc}
protected string
getLinkDomain(array $context = [])
Gets the link domain.
__construct(CacheBackendInterface $cache, EntityTypeManagerInterface $entity_type_manager, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory, RequestStack $request_stack, EntityTypeBundleInfoInterface $entity_type_bundle_info, EntityFieldManagerInterface $entity_field_manager)
Constructor.
string
getRelationUri(string $entity_type, string $bundle, string $field_name, array $context = [])
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.
array
getRelationInternalIds(string $relation_uri, $context = [])
Translates a REST URI into internal IDs.
protected array
getRelations(array $context = [])
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.
protected array
writeCache(array $context = [])
Writes the cache of relation links.