public function WebformEntityReferenceTrait::buildExportOptionsForm in Webform 6.x
Same name and namespace in other branches
- 8.5 src/Plugin/WebformElement/WebformEntityReferenceTrait.php \Drupal\webform\Plugin\WebformElement\WebformEntityReferenceTrait::buildExportOptionsForm()
File
- src/
Plugin/ WebformElement/ WebformEntityReferenceTrait.php, line 245
Class
- WebformEntityReferenceTrait
- Provides an 'entity_reference' trait.
Namespace
Drupal\webform\Plugin\WebformElementCode
public function buildExportOptionsForm(array &$form, FormStateInterface $form_state, array $export_options) {
if (isset($form['entity_reference'])) {
return;
}
$form['entity_reference'] = [
'#type' => 'details',
'#title' => $this
->t('Entity reference options'),
'#open' => TRUE,
];
$form['entity_reference']['entity_reference_items'] = [
'#type' => 'checkboxes',
'#title' => $this
->t('Entity reference format'),
'#options' => [
'id' => $this
->t("ID, an entity's unique identified"),
'title' => $this
->t("Title, an entity's title/label"),
'url' => $this
->t("URL, an entity's URL"),
],
'#required' => TRUE,
'#default_value' => $export_options['entity_reference_items'],
'#element_validate' => [
[
get_class($this),
'validateEntityReferenceFormat',
],
],
];
}