You are here

public function Price::getInfo in Price 8

Same name and namespace in other branches
  1. 3.x src/Element/Price.php \Drupal\price\Element\Price::getInfo()
  2. 2.0.x src/Element/Price.php \Drupal\price\Element\Price::getInfo()
  3. 2.x src/Element/Price.php \Drupal\price\Element\Price::getInfo()
  4. 3.0.x src/Element/Price.php \Drupal\price\Element\Price::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/Price.php, line 32

Class

Price
Provides a price form element.

Namespace

Drupal\price\Element

Code

public function getInfo() {
  $class = get_class($this);
  return [
    // List of currencies codes. If empty, all currencies will be available.
    '#available_currencies' => [],
    // The check is performed here so that it is cached.
    '#price_inline_errors' => \Drupal::moduleHandler()
      ->moduleExists('inline_form_errors'),
    '#size' => 10,
    '#maxlength' => 128,
    '#default_value' => NULL,
    '#allow_negative' => FALSE,
    '#attached' => [
      'library' => [
        'price/admin',
      ],
    ],
    '#element_validate' => [
      [
        $class,
        'moveInlineErrors',
      ],
    ],
    '#process' => [
      [
        $class,
        'processElement',
      ],
      [
        $class,
        'processAjaxForm',
      ],
      [
        $class,
        'processGroup',
      ],
    ],
    '#pre_render' => [
      [
        $class,
        'preRenderGroup',
      ],
    ],
    '#input' => TRUE,
    '#theme_wrappers' => [
      'container',
    ],
  ];
}