You are here

public function Duration::getInfo in Duration Field 8

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/Duration.php, line 20

Class

Duration
Provides a duration form element.

Namespace

Drupal\duration_field\Element

Code

public function getInfo() {
  $class = get_class($this);
  return [
    '#input' => TRUE,
    '#tree' => TRUE,
    '#granularity' => 'y:m:d:h:i:s',
    // Required elements should be in the format y:m:d:h:i:s.
    '#required_elements' => '',
    '#element_validate' => [
      [
        $class,
        'validateElement',
      ],
    ],
    '#pre_render' => [
      [
        $class,
        'preRenderElement',
      ],
    ],
    '#process' => [
      'Drupal\\Core\\Render\\Element\\RenderElement::processAjaxForm',
      [
        $class,
        'processElement',
      ],
    ],
    '#theme_wrappers' => [
      'form_element',
    ],
  ];
}