Drupal 8  8.0.2
ContentEntityNormalizer Class Reference
Inheritance diagram for ContentEntityNormalizer:

Public Member Functions

 __construct (LinkManagerInterface $link_manager, EntityManagerInterface $entity_manager, ModuleHandlerInterface $module_handler)
 
 denormalize ($data, $class, $format=NULL, array $context=array())
 
- Public Member Functions inherited from NormalizerBase
 supportsNormalization ($data, $format=NULL)
 
 supportsDenormalization ($data, $type, $format=NULL)
 
- Public Member Functions inherited from NormalizerBase
 supportsNormalization ($data, $format=NULL)
 
 supportsDenormalization ($data, $type, $format=NULL)
 

Protected Member Functions

 getEntityUri (EntityInterface $entity)
 
 getTypedDataIds ($types, $context=array())
 
- Protected Member Functions inherited from NormalizerBase
 checkFormat ($format=NULL)
 

Protected Attributes

 $supportedInterfaceOrClass = 'Drupal\Core\Entity\ContentEntityInterface'
 
 $linkManager
 
 $entityManager
 
 $moduleHandler
 
- Protected Attributes inherited from NormalizerBase
 $formats = array('hal_json')
 
- Protected Attributes inherited from NormalizerBase
 $supportedInterfaceOrClass
 

Detailed Description

Converts the Drupal entity object structure to a HAL array structure.

Constructor & Destructor Documentation

__construct ( LinkManagerInterface  $link_manager,
EntityManagerInterface  $entity_manager,
ModuleHandlerInterface  $module_handler 
)

Constructs an ContentEntityNormalizer object.

Parameters
\Drupal\rest\LinkManager\LinkManagerInterface$link_managerThe hypermedia link manager.

References Drupal\entityManager(), and Drupal\moduleHandler().

Here is the call graph for this function:

Member Function Documentation

denormalize (   $data,
  $class,
  $format = NULL,
array  $context = array() 
)

Implements ::denormalize().

Parameters
array$dataEntity data to restore.
string$classUnused, entity_create() is used to instantiate entity objects.
string$formatFormat the given data was extracted from.
array$contextOptions available to the denormalizer. Keys that can be used:
  • request_method: if set to "patch" the denormalization will clear out all default values for entity fields before applying $data to the entity.
Returns
An unserialized entity object containing the data in $data.
Exceptions
\Symfony\Component\Serializer\Exception\UnexpectedValueException

References Drupal\entityManager(), and ContentEntityNormalizer\getTypedDataIds().

Here is the call graph for this function:

getEntityUri ( EntityInterface  $entity)
protected

Constructs the entity URI.

Parameters
\Drupal\Core\Entity\EntityInterfaceThe entity.
Returns
string The entity URI.

References EntityInterface\hasLinkTemplate(), EntityInterface\isNew(), EntityInterface\url(), and EntityInterface\urlInfo().

Referenced by FileEntityNormalizer\normalize().

Here is the call graph for this function:

Here is the caller graph for this function:

getTypedDataIds (   $types,
  $context = array() 
)
protected

Gets the typed data IDs for a type URI.

Parameters
array$typesThe type array(s) (value of the 'type' attribute of the incoming data).
array$contextContext from the normalizer/serializer operation.
Returns
array The typed data IDs.

Referenced by ContentEntityNormalizer\denormalize().

Here is the caller graph for this function:


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