class TargetIdResolver in Drupal 10
Same name and namespace in other branches
- 8 core/modules/serialization/src/EntityResolver/TargetIdResolver.php \Drupal\serialization\EntityResolver\TargetIdResolver
- 9 core/modules/serialization/src/EntityResolver/TargetIdResolver.php \Drupal\serialization\EntityResolver\TargetIdResolver
Resolves entities from data that contains an entity target ID.
Hierarchy
- class \Drupal\serialization\EntityResolver\TargetIdResolver implements EntityResolverInterface
Expanded class hierarchy of TargetIdResolver
1 string reference to 'TargetIdResolver'
- serialization.services.yml in core/
modules/ serialization/ serialization.services.yml - core/modules/serialization/serialization.services.yml
1 service uses TargetIdResolver
- serialization.entity_resolver.target_id in core/
modules/ serialization/ serialization.services.yml - Drupal\serialization\EntityResolver\TargetIdResolver
File
- core/
modules/ serialization/ src/ EntityResolver/ TargetIdResolver.php, line 10
Namespace
Drupal\serialization\EntityResolverView source
class TargetIdResolver implements EntityResolverInterface {
/**
* {@inheritdoc}
*/
public function resolve(NormalizerInterface $normalizer, $data, $entity_type) {
if (isset($data['target_id'])) {
return $data['target_id'];
}
return NULL;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TargetIdResolver:: |
public | function |
Returns the local ID of an entity referenced by serialized data. Overrides EntityResolverInterface:: |