TargetIdResolver.php in Drupal 8
Same filename and directory in other branches
Namespace
Drupal\serialization\EntityResolverFile
core/modules/serialization/src/EntityResolver/TargetIdResolver.phpView 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
Name | Description |
---|---|
TargetIdResolver | Resolves entities from data that contains an entity target ID. |