You are here

public function LinkFieldMapping::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/LinkFieldMapping.php, line 30

Class

LinkFieldMapping
Provides link 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);
}