You are here

public function WebformLikert::initialize in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElement/WebformLikert.php \Drupal\webform\Plugin\WebformElement\WebformLikert::initialize()

Initialize an element to be displayed, rendered, or exported.

Parameters

array $element: An element.

Overrides WebformElementBase::initialize

File

src/Plugin/WebformElement/WebformLikert.php, line 83

Class

WebformLikert
Provides a 'likert' element.

Namespace

Drupal\webform\Plugin\WebformElement

Code

public function initialize(array &$element) {
  parent::initialize($element);

  // Set element answers.
  if (isset($element['#answers'])) {
    $element['#answers'] = WebformOptions::getElementOptions($element, '#answers');
  }

  // Process answers and set N/A.
  WebformLikertElement::processWebformLikertAnswers($element);
}