You are here

public static function WebformOptionsHelper::getOptionsText in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Utility/WebformOptionsHelper.php \Drupal\webform\Utility\WebformOptionsHelper::getOptionsText()

Replace associative array of option values with option text.

Parameters

array $values: The option value.

array $options: An associative array of options.

Return value

array An associative array of option values with option text.

1 call to WebformOptionsHelper::getOptionsText()
WebformOptionsHelperTest::testGetOptionsText in tests/src/Unit/Utility/WebformOptionsHelperTest.php
Tests WebformOptionsHelper::getOptionsText().

File

src/Utility/WebformOptionsHelper.php, line 77

Class

WebformOptionsHelper
Helper class webform options based methods.

Namespace

Drupal\webform\Utility

Code

public static function getOptionsText(array $values, array $options) {
  foreach ($values as &$value) {
    $value = self::getOptionText($value, $options);
  }
  return $values;
}