public function WebformMapping::initialize in Webform 8.5
Same name and namespace in other branches
- 6.x 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 84
Class
- WebformMapping
- Provides a 'mapping' element.
Namespace
Drupal\webform\Plugin\WebformElementCode
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');
}
}