You are here

public function Number::getInfo in Commerce Core 8.2

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

modules/price/src/Element/Number.php, line 34

Class

Number
Provides a number form element with support for language-specific input.

Namespace

Drupal\commerce_price\Element

Code

public function getInfo() {
  $class = get_class($this);
  return [
    '#min_fraction_digits' => 0,
    '#max_fraction_digits' => 6,
    '#min' => 0,
    '#max' => NULL,
    '#size' => 10,
    '#maxlength' => 128,
    '#default_value' => NULL,
    '#element_validate' => [
      [
        $class,
        'validateNumber',
      ],
    ],
    '#process' => [
      [
        $class,
        'processElement',
      ],
      [
        $class,
        'processAjaxForm',
      ],
      [
        $class,
        'processGroup',
      ],
    ],
    '#pre_render' => [
      [
        $class,
        'preRenderNumber',
      ],
      [
        $class,
        'preRenderGroup',
      ],
    ],
    '#input' => TRUE,
    '#theme' => 'input__textfield',
    '#theme_wrappers' => [
      'form_element',
    ],
  ];
}