Drupal 8  8.0.2
UuidResolver Class Reference
Inheritance diagram for UuidResolver:

Public Member Functions

 __construct (EntityManagerInterface $entity_manager)
 resolve (NormalizerInterface $normalizer, $data, $entity_type)

Protected Attributes


Detailed Description

Resolves entities from data that contains an entity UUID.

Constructor & Destructor Documentation

__construct ( EntityManagerInterface  $entity_manager)

Constructs a UuidResolver object.

\Drupal\Core\Entity\EntityManagerInterface$entity_managerThe entity manager.

References Drupal\entityManager().

Here is the call graph for this function:

Member Function Documentation

resolve ( NormalizerInterface  $normalizer,

{Returns the local ID of an entity referenced by serialized data.Drupal entities are loaded by and internally referenced by a local ID. Because different websites can use the same local ID to refer to different entities (e.g., node "1" can be a different node on foo.com and bar.com, or on example.com and staging.example.com), it is generally unsuitable for use in hypermedia data exchanges. Instead, UUIDs, URIs, or other globally unique IDs are preferred.This function takes a $data array representing partially deserialized data for an entity reference, and resolves it to a local entity ID. For example, depending on the data specification being used, $data might contain a 'uuid' key, a 'uri' key, a 'href' key, or some other data identifying the entity, and it is up to the implementor of this interface to resolve that appropriately for the specification being used.

\Symfony\Component\Serializer\Normalizer\NormalizerInterface$normalizerThe Normalizer which is handling the data.
array$dataThe data passed into the calling Normalizer.
string$entity_typeThe type of entity being resolved; e.g., 'node' or 'user'.
string|null Returns the local entity ID, if found. Otherwise, returns NULL.

Implements EntityResolverInterface.

References Drupal\entityManager().

Here is the call graph for this function:

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