You are here

public function OfficeHoursDatetime::getInfo in Office Hours 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 Datetime::getInfo

File

src/Element/OfficeHoursDatetime.php, line 20

Class

OfficeHoursDatetime
Provides a one-line HTML5 time element.

Namespace

Drupal\office_hours\Element

Code

public function getInfo() {
  $parent_info = parent::getInfo();
  $info = [
    '#process' => [
      [
        static::class,
        'processOfficeHoursTime',
      ],
    ],
    '#element_validate' => [
      [
        static::class,
        'validateOfficeHoursTime',
      ],
    ],
    // @see Drupal\Core\Datetime\Element\Datetime.
    '#date_date_element' => 'none',
    // {'none'|'date'}
    '#date_date_format' => 'none',
    '#date_time_element' => 'time',
    // {'none'|'time'|'text'}
    // @see Drupal\Core\Datetime\Element\DateElementBase.
    '#date_timezone' => '+0000',
  ];

  // #process: bottom-up.
  $info['#process'] = array_merge($parent_info['#process'], $info['#process']);
  return $info + $parent_info;
}