protected function ContentFieldMetadataTrait::setFieldMetaData in Acquia Content Hub 8.2
Sets field metadata.
Parameters
\Drupal\acquia_contenthub\Event\SerializeCdfEntityFieldEvent $event: Event.
5 calls to ContentFieldMetadataTrait::setFieldMetaData()
- FallbackFieldSerializer::onSerializeContentField in src/
EventSubscriber/ SerializeContentField/ FallbackFieldSerializer.php - Directly reference the field's value property.
- GeneralFieldSerializer::onSerializeContentField in src/
EventSubscriber/ SerializeContentField/ GeneralFieldSerializer.php - Directly reference the field's value property.
- LanguageFieldSerializer::onSerializeContentField in src/
EventSubscriber/ SerializeContentField/ LanguageFieldSerializer.php - Directly reference the field's value as the language.
- LayoutBuilderFieldSerializer::onSerializeContentField in src/
EventSubscriber/ SerializeContentField/ LayoutBuilderFieldSerializer.php - Prepare layout builder field.
- TextItemFieldSerializer::onSerializeContentField in src/
EventSubscriber/ SerializeContentField/ TextItemFieldSerializer.php - Extract filter format UUID and place it into the serialized field values.
File
- src/
EventSubscriber/ SerializeContentField/ ContentFieldMetadataTrait.php, line 20
Class
- ContentFieldMetadataTrait
- Trait to set content field metadata.
Namespace
Drupal\acquia_contenthub\EventSubscriber\SerializeContentFieldCode
protected function setFieldMetaData(SerializeCdfEntityFieldEvent $event) {
$cdf = $event
->getCdf();
$metadata = $cdf
->getMetadata();
$metadata['field'][$event
->getFieldName()]['type'] = $event
->getField()
->getFieldDefinition()
->getType();
$cdf
->setMetadata($metadata);
}