You are here

protected function YamlFormOptionsForm::getOptions in YAML Form 8

Get options.

Return value

array An associative array of options.

2 calls to YamlFormOptionsForm::getOptions()
YamlFormOptionsForm::editForm in src/YamlFormOptionsForm.php
Edit form options source code form.
YamlFormUiOptionsForm::editForm in modules/yamlform_ui/src/YamlFormUiOptionsForm.php
Edit form options source code form.

File

src/YamlFormOptionsForm.php, line 143

Class

YamlFormOptionsForm
Provides a form to set options.

Namespace

Drupal\yamlform

Code

protected function getOptions($form, $form_state) {

  /** @var \Drupal\yamlform\YamlFormOptionsInterface $yamlform_options */
  $yamlform_options = $this
    ->buildEntity($form, $form_state);
  $options = $yamlform_options
    ->getOptions();
  if (empty($options)) {
    $options = YamlFormOptions::getElementOptions([
      '#options' => $yamlform_options
        ->id(),
    ]);
  }
  return YamlFormOptionsHelper::convertOptionsToString($options);
}