You are here

public function WebformLikert::getInfo in Webform 8.5

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

Returns the element properties for this element.

Return value

array An array of element properties. See \Drupal\Core\Render\ElementInfoManagerInterface::getInfo() for documentation of the standard properties of all elements, and the return value format.

Overrides ElementInterface::getInfo

File

src/Element/WebformLikert.php, line 23

Class

WebformLikert
Provides a webform element for a likert scale.

Namespace

Drupal\webform\Element

Code

public function getInfo() {
  $class = get_class($this);
  return [
    '#input' => TRUE,
    '#process' => [
      [
        $class,
        'processWebformLikert',
      ],
      [
        $class,
        'processAjaxForm',
      ],
    ],
    '#theme_wrappers' => [
      'form_element',
    ],
    '#required' => FALSE,
    '#required_error' => '',
    '#sticky' => TRUE,
    '#questions' => [],
    '#questions_description_display' => 'description',
    // Using #answers instead of #options to prevent triggering
    // \Drupal\Core\Form\FormValidator::performRequiredValidation().
    '#answers' => [],
    '#answers_description_display' => 'description',
    '#na_answer' => FALSE,
    '#na_answer_text' => '',
    '#na_answer_value' => '',
  ];
}