You are here

protected function WebformOptionsForm::getOptions in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/WebformOptionsForm.php \Drupal\webform\WebformOptionsForm::getOptions()

Get options.

Return value

array An associative array of options.

2 calls to WebformOptionsForm::getOptions()
WebformOptionsForm::editForm in src/WebformOptionsForm.php
Edit webform options source code form.
WebformUiOptionsForm::editForm in modules/webform_ui/src/WebformUiOptionsForm.php
Edit webform options source code form.

File

src/WebformOptionsForm.php, line 221

Class

WebformOptionsForm
Provides a form to set options.

Namespace

Drupal\webform

Code

protected function getOptions() {

  /** @var \Drupal\webform\WebformOptionsInterface $webform_options */
  $webform_options = $this
    ->getEntity();
  $options = $webform_options
    ->getOptions();
  if (empty($options)) {
    $element = [
      '#options' => $webform_options
        ->id(),
    ];
    $options = WebformOptions::getElementOptions($element);
  }
  return WebformOptionsHelper::convertOptionsToString($options);
}