You are here

interface FieldMappingInterface in Webform Content Creator 3.x

Interface for the field mapping.

Hierarchy

Expanded class hierarchy of FieldMappingInterface

All classes that implement FieldMappingInterface

4 files declare their use of FieldMappingInterface
EntityReferenceFieldMapping.php in src/Plugin/WebformContentCreator/FieldMapping/EntityReferenceFieldMapping.php
NumericFieldMapping.php in src/Plugin/WebformContentCreator/FieldMapping/NumericFieldMapping.php
SocialMediaLinksFieldMapping.php in src/Plugin/WebformContentCreator/FieldMapping/SocialMediaLinksFieldMapping.php
TextFieldMapping.php in src/Plugin/WebformContentCreator/FieldMapping/TextFieldMapping.php

File

src/Plugin/FieldMappingInterface.php, line 13

Namespace

Drupal\webform_content_creator\Plugin
View source
interface FieldMappingInterface extends PluginInspectionInterface {
  const WEBFORM_OPTIONS_ELEMENTS = [
    "checkboxes",
    "webform_checkboxes_other",
    "webform_likert",
    "radios",
    "webform_radios_other",
    "select",
    "webform_select_other",
    "tableselect",
    "webform_tableselect_sort",
    "webform_table_sort",
  ];
  const WEBFORM_ENTIY_REFERENCE_ELEMENTS = [
    "entity_autocomplete",
    "webform_entity_checkboxes",
    "webform_entity_radios",
    "webform_entity_select",
    "webform_term_checkboxes",
    "webform_term_select",
  ];
  const WEBFORM_TEXT_ELEMENTS = [
    "textarea",
    "textfield",
    "hidden",
  ];

  /**
   * Returns whether the mapper supports custom field text
   *
   * @return bool
   */
  public function supportsCustomFields();

  /**
   * Returns the entity component fields.
   *
   * @return array
   *   returns an array of the component fields that makeup this field
   */
  public function getEntityComponentFields(FieldDefinitionInterface $field_definition);

  /**
   * @param $webform_id
   *
   * @return mixed
   */
  public function getSupportedWebformFields($webform_id);

  /**
   * Use a single mapping to set an entity field value.
   *
   * @param \Drupal\Core\Entity\ContentEntityInterface &$content
   *   Content being mapped with a webform submission.
   * @param array $webform_element
   *   Webform element
   * @param array $data
   *   Webform submission data.
   * @param FieldDefinitionInterface $field_definition
   *   Entity field defintition.
   *
   * @return \Drupal\Core\Entity\ContentEntityInterface
   *   Created content item.
   */
  public function mapEntityField(ContentEntityInterface &$content, array $webform_element, array $data = [], FieldDefinitionInterface $field_definition);

}

Members

Namesort descending Modifiers Type Description Overrides
FieldMappingInterface::getEntityComponentFields public function Returns the entity component fields. 1
FieldMappingInterface::getSupportedWebformFields public function 1
FieldMappingInterface::mapEntityField public function Use a single mapping to set an entity field value. 1
FieldMappingInterface::supportsCustomFields public function Returns whether the mapper supports custom field text 1
FieldMappingInterface::WEBFORM_ENTIY_REFERENCE_ELEMENTS constant
FieldMappingInterface::WEBFORM_OPTIONS_ELEMENTS constant
FieldMappingInterface::WEBFORM_TEXT_ELEMENTS constant
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2