class FieldCollectionItemNormalizer in Field collection 8
Same name and namespace in other branches
- 8.3 src/Normalizer/FieldCollectionItemNormalizer.php \Drupal\field_collection\Normalizer\FieldCollectionItemNormalizer
Adds field collection items to field collections.
Hierarchy
- class \Drupal\serialization\Normalizer\NormalizerBase implements \Symfony\Component\Serializer\SerializerAwareInterface, CacheableNormalizerInterface uses \Symfony\Component\Serializer\SerializerAwareTrait
- class \Drupal\serialization\Normalizer\ComplexDataNormalizer
- class \Drupal\field_collection\Normalizer\FieldCollectionItemNormalizer
- class \Drupal\serialization\Normalizer\ComplexDataNormalizer
Expanded class hierarchy of FieldCollectionItemNormalizer
1 string reference to 'FieldCollectionItemNormalizer'
1 service uses FieldCollectionItemNormalizer
File
- src/
Normalizer/ FieldCollectionItemNormalizer.php, line 11
Namespace
Drupal\field_collection\NormalizerView source
class FieldCollectionItemNormalizer extends ComplexDataNormalizer {
//
/**
* The interface or class that this Normalizer supports.
*
* @var string
*/
protected $supportedInterfaceOrClass = FieldCollection::class;
/**
* {@inheritdoc}
*/
public function normalize($field_item, $format = NULL, array $context = []) {
// Set the normalized field output to the field collection item.
$values = $this->serializer
->normalize($field_item
->getFieldCollectionItem(), $format, $context);
return $values;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheableNormalizerInterface:: |
constant | Name of key for bubbling cacheability metadata via serialization context. | ||
FieldCollectionItemNormalizer:: |
protected | property |
The interface or class that this Normalizer supports. Overrides ComplexDataNormalizer:: |
|
FieldCollectionItemNormalizer:: |
public | function |
Normalizes an object into a set of arrays/scalars. Overrides ComplexDataNormalizer:: |
|
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 |