class TargetIdResolver in Zircon Profile 8
Same name and namespace in other branches
- 8.0 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 file declares its use of TargetIdResolver
- NormalizerTestBase.php in core/
modules/ hal/ src/ Tests/ NormalizerTestBase.php - Contains \Drupal\hal\Tests\NormalizerTestBase.
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 15 - Contains \Drupal\serialization\EntityResolver\TargetIdResolver.
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:: |