You are here

public function WebformMapping::initialize in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElement/WebformMapping.php \Drupal\webform\Plugin\WebformElement\WebformMapping::initialize()

Initialize an element to be displayed, rendered, or exported.

Parameters

array $element: An element.

Overrides WebformElementBase::initialize

File

src/Plugin/WebformElement/WebformMapping.php, line 101

Class

WebformMapping
Provides a 'mapping' element.

Namespace

Drupal\webform\Plugin\WebformElement

Code

public function initialize(array &$element) {
  parent::initialize($element);

  // Set element answers.
  if (isset($element['#source'])) {
    $element['#source'] = WebformOptions::getElementOptions($element, '#source');
  }
  if (isset($element['#destination'])) {
    $element['#destination'] = WebformOptions::getElementOptions($element, '#destination');
  }
}