Drupal 8  8.0.2
TypeLinkManager Class Reference
Inheritance diagram for TypeLinkManager:

Public Member Functions

 __construct (CacheBackendInterface $cache, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory, RequestStack $request_stack)
 
 getTypeUri ($entity_type, $bundle, $context=array())
 
 getTypeInternalIds ($type_uri, $context=array())
 

Protected Member Functions

 getTypes ($context=array())
 
 writeCache ($context=array())
 

Protected Attributes

 $cache
 
 $moduleHandler
 

Constructor & Destructor Documentation

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

Constructor.

Parameters
\Drupal\Core\Cache\CacheBackendInterface$cacheThe injected cache backend for caching type URIs.
\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\moduleHandler(), and Drupal\requestStack().

Here is the call graph for this function:

Member Function Documentation

getTypeInternalIds (   $type_uri,
  $context = array() 
)

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

Parameters
string$type_uriThe type URI.
array$contextContext from the normalizer/serializer operation.
Returns
array | boolean If the URI matches a bundle, returns an array containing entity_type and bundle. Otherwise, returns false.
}

Implements TypeLinkManagerInterface.

References TypeLinkManager\getTypes().

Here is the call graph for this function:

getTypes (   $context = array())
protected

Get the array of type links.

Parameters
array$contextContext from the normalizer/serializer operation.
Returns
array An array of typed data ids (entity_type and bundle) keyed by corresponding type URI.

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

Referenced by TypeLinkManager\getTypeInternalIds().

Here is the call graph for this function:

Here is the caller graph for this function:

getTypeUri (   $entity_type,
  $bundle,
  $context = array() 
)

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

Implements TypeLinkManagerInterface.

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

Referenced by TypeLinkManager\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 type links.

Parameters
array$contextContext from the normalizer/serializer operation.

References Drupal\cache(), Drupal\entityManager(), TypeLinkManager\getTypeUri(), and Cache\PERMANENT.

Referenced by TypeLinkManager\getTypes().

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: