You are here

public function WebformOptionsStorage::getLikerts in Webform 8.5

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

Get all likert options with 'Likert:' prefix removed.

Return value

string[] An array of likert options.

Overrides WebformOptionsStorageInterface::getLikerts

File

src/WebformOptionsStorage.php, line 130

Class

WebformOptionsStorage
Storage controller class for "webform_options" configuration entities.

Namespace

Drupal\webform

Code

public function getLikerts() {
  $webform_options = $this
    ->loadByProperties([
    'likert' => TRUE,
  ]);
  @uasort($webform_options, [
    $this->entityType
      ->getClass(),
    'sort',
  ]);
  $likert_options = [];
  foreach ($webform_options as $id => $webform_option) {
    $likert_options[$id] = str_replace(t('Likert') . ': ', '', $webform_option
      ->label());
  }
  return $likert_options;
}