class TraversableObjectNormalizer in JSON:API 8
Same name and namespace in other branches
- 8.2 tests/modules/jsonapi_test_data_type/src/Normalizer/TraversableObjectNormalizer.php \Drupal\jsonapi_test_data_type\Normalizer\TraversableObjectNormalizer
Normalizes TraversableObject.
Hierarchy
- class \Drupal\serialization\Normalizer\NormalizerBase implements \Symfony\Component\Serializer\SerializerAwareInterface, CacheableNormalizerInterface uses \Symfony\Component\Serializer\SerializerAwareTrait
- class \Drupal\jsonapi_test_data_type\Normalizer\TraversableObjectNormalizer
Expanded class hierarchy of TraversableObjectNormalizer
1 string reference to 'TraversableObjectNormalizer'
- jsonapi_test_data_type.services.yml in tests/
modules/ jsonapi_test_data_type/ jsonapi_test_data_type.services.yml - tests/modules/jsonapi_test_data_type/jsonapi_test_data_type.services.yml
1 service uses TraversableObjectNormalizer
- serializer.normalizer.traversable_object.jsonapi_test_data_type in tests/
modules/ jsonapi_test_data_type/ jsonapi_test_data_type.services.yml - Drupal\jsonapi_test_data_type\Normalizer\TraversableObjectNormalizer
File
- tests/
modules/ jsonapi_test_data_type/ src/ Normalizer/ TraversableObjectNormalizer.php, line 11
Namespace
Drupal\jsonapi_test_data_type\NormalizerView source
class TraversableObjectNormalizer extends NormalizerBase {
/**
* {@inheritdoc}
*/
protected $supportedInterfaceOrClass = TraversableObject::class;
/**
* {@inheritdoc}
*/
public function normalize($object, $format = NULL, array $context = []) {
return $object->property;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheableNormalizerInterface:: |
constant | Name of key for bubbling cacheability metadata via serialization context. | ||
NormalizerBase:: |
protected | property | List of formats which supports (de-)normalization. | 3 |
NormalizerBase:: |
protected | function | Adds cacheability if applicable. | |
NormalizerBase:: |
protected | function | Checks if the provided format is supported by this normalizer. | 2 |
NormalizerBase:: |
public | function | Implements \Symfony\Component\Serializer\Normalizer\DenormalizerInterface::supportsDenormalization() | 1 |
NormalizerBase:: |
public | function | Checks whether the given class is supported for normalization by this normalizer. | 1 |
TraversableObjectNormalizer:: |
protected | property |
The interface or class that this Normalizer supports. Overrides NormalizerBase:: |
|
TraversableObjectNormalizer:: |
public | function | Normalizes an object into a set of arrays/scalars. |