You are here

public static function WebformOptionsCustomEntity::setTemplateOptions in Webform 6.x

Same name and namespace in other branches
  1. 8.5 modules/webform_options_custom/src/Element/WebformOptionsCustomEntity.php \Drupal\webform_options_custom\Element\WebformOptionsCustomEntity::setTemplateOptions()

Set a custom options element #options property.

Parameters

array $element: A custom options element.

Overrides WebformOptionsCustom::setTemplateOptions

File

modules/webform_options_custom/src/Element/WebformOptionsCustomEntity.php, line 19

Class

WebformOptionsCustomEntity
Provides a webform element for a selecting custom entity references from HTML or SVG markup.

Namespace

Drupal\webform_options_custom\Element

Code

public static function setTemplateOptions(array &$element) {
  if (isset($element['#_options_custom'])) {
    return;
  }

  // Remove any prefine #options so the entity reference options will be used.
  unset($element['#options']);
  parent::setTemplateOptions($element);
}