You are here

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

Use a single mapping to set an entity field value.

Overrides FieldMappingBase::mapEntityField

File

src/Plugin/WebformContentCreator/FieldMapping/NumericFieldMapping.php, line 35

Class

NumericFieldMapping
Provides numeric field mapping.

Namespace

Drupal\webform_content_creator\Plugin\WebformContentCreator\FieldMapping

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);
}