class TypeLinkManager extends LinkManagerBase implements TypeLinkManagerInterface (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

Injected cache backend.

protected ModuleHandlerInterface $moduleHandler

Module handler service.

protected EntityTypeBundleInfoInterface $bundleInfoService

The bundle info service.

protected EntityTypeManagerInterface $entityTypeManager

The entity type manager.

Methods

setLinkDomain($domain)

{@inheritdoc}

string
getLinkDomain(array $context = [])

Gets the link domain.

__construct(CacheBackendInterface $cache, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory, RequestStack $request_stack, EntityTypeBundleInfoInterface $bundle_info_service, EntityTypeManagerInterface $entity_type_manager)

Constructor.

string
getTypeUri($entity_type, $bundle, array $context = [])

Gets the URI that corresponds to a bundle.

array|bool
getTypeInternalIds(string $type_uri, array $context = [])

Get a bundle's Typed Data IDs based on a URI.

array
getTypes(array $context = [])

Get the array of type links.

array
writeCache(array $context = [])

Writes the cache of type links.

Details

setLinkDomain($domain)

{@inheritdoc}

Parameters

$domain

protected string getLinkDomain(array $context = [])

Gets the link domain.

Parameters

array $context

Normalization/serialization context.

Return Value

string

The link domain.

See also

\Symfony\Component\Serializer\Normalizer\NormalizerInterface::normalize()
\Symfony\Component\Serializer\SerializerInterface::serialize()
CacheableNormalizerInterface::SERIALIZATION_CONTEXT_CACHEABILITY

__construct(CacheBackendInterface $cache, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory, RequestStack $request_stack, EntityTypeBundleInfoInterface $bundle_info_service, EntityTypeManagerInterface $entity_type_manager)

Constructor.

Parameters

CacheBackendInterface $cache

The injected cache backend for caching type URIs.

ModuleHandlerInterface $module_handler

The module handler service.

ConfigFactoryInterface $config_factory

The config factory service.

RequestStack $request_stack

The request stack.

EntityTypeBundleInfoInterface $bundle_info_service

The bundle info service.

EntityTypeManagerInterface $entity_type_manager

The entity type manager.

string getTypeUri($entity_type, $bundle, array $context = [])

Gets the URI that corresponds to a bundle.

When using hypermedia formats, this URI can be used to indicate which bundle the data represents. Documentation about required and optional fields can also be provided at this URI.

Parameters

$entity_type

The bundle's entity type.

$bundle

The bundle name.

array $context

(optional) Optional serializer/normalizer context.

Return Value

string

The corresponding URI for the bundle.

array|bool getTypeInternalIds(string $type_uri, array $context = [])

Get a bundle's Typed Data IDs based on a URI.

Parameters

string $type_uri

The type URI.

array $context

Context from the normalizer/serializer operation.

Return Value

array|bool

If the URI matches a bundle, returns an array containing entity_type and bundle. Otherwise, returns false.

protected array getTypes(array $context = [])

Get the array of type links.

Parameters

array $context

Context from the normalizer/serializer operation.

Return Value

array

An array of typed data ids (entity_type and bundle) keyed by corresponding type URI.

protected array writeCache(array $context = [])

Writes the cache of type links.

Parameters

array $context

Context from the normalizer/serializer operation.

Return Value

array

An array of typed data ids (entity_type and bundle) keyed by corresponding type URI.