TargetIdResolver.php
Same filename in other branches
Namespace
Drupal\serialization\EntityResolverFile
-
core/
modules/ serialization/ src/ EntityResolver/ TargetIdResolver.php
View source
<?php
namespace Drupal\serialization\EntityResolver;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
/**
* Resolves entities from data that contains an entity target ID.
*/
class TargetIdResolver implements EntityResolverInterface {
/**
* {@inheritdoc}
*/
public function resolve(NormalizerInterface $normalizer, $data, $entity_type) {
if (isset($data['target_id'])) {
return $data['target_id'];
}
return NULL;
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
TargetIdResolver | Resolves entities from data that contains an entity target ID. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.