You are here

public function FieldMappingBase::mapEntityField in Webform Content Creator 3.x

Use a single mapping to set an entity field value.

Overrides FieldMappingInterface::mapEntityField

1 call to FieldMappingBase::mapEntityField()
DefaultFieldMapping::mapEntityField in src/Plugin/WebformContentCreator/FieldMapping/DefaultFieldMapping.php
Use a single mapping to set an entity field value.
10 methods override FieldMappingBase::mapEntityField()
AddressFieldMapping::mapEntityField in src/Plugin/WebformContentCreator/FieldMapping/AddressFieldMapping.php
Use a single mapping to set an entity field value.
BooleanFieldMapping::mapEntityField in src/Plugin/WebformContentCreator/FieldMapping/BooleanFieldMapping.php
Use a single mapping to set an entity field value.
DateTimeFieldMapping::mapEntityField in src/Plugin/WebformContentCreator/FieldMapping/DateTimeFieldMapping.php
Use a single mapping to set an entity field value.
DefaultFieldMapping::mapEntityField in src/Plugin/WebformContentCreator/FieldMapping/DefaultFieldMapping.php
Use a single mapping to set an entity field value.
EmailFieldMapping::mapEntityField in src/Plugin/WebformContentCreator/FieldMapping/EmailFieldMapping.php
Use a single mapping to set an entity field value.

... See full list

File

src/Plugin/FieldMappingBase.php, line 72

Class

FieldMappingBase
Base for a field mapping plugin.

Namespace

Drupal\webform_content_creator\Plugin

Code

public function mapEntityField(ContentEntityInterface &$content, array $webform_element, array $data = [], FieldDefinitionInterface $field_definition) {
  $field_id = $field_definition
    ->getName();
  $field_value = $data[$field_id];
  $content
    ->set($field_id, $field_value);
}