You are here

protected function DateList::setConfigurationFormDefaultValue in YAML Form 8

Set an element's configuration form element default value.

Parameters

array $form: An element's configuration form.

array $element_properties: The element's properties without hash prefix.

array $property_element: The form input used to set an element's property.

string $property_name: THe property's name.

Overrides YamlFormElementBase::setConfigurationFormDefaultValue

File

src/Plugin/YamlFormElement/DateList.php, line 145

Class

DateList
Provides a 'datelist' element.

Namespace

Drupal\yamlform\Plugin\YamlFormElement

Code

protected function setConfigurationFormDefaultValue(array &$form, array &$element_properties, array &$property_element, $property_name) {
  if (in_array($property_name, [
    'date_text_parts',
    'date_part_order',
  ])) {
    $element_properties[$property_name] = array_combine($element_properties[$property_name], $element_properties[$property_name]);
  }
  parent::setConfigurationFormDefaultValue($form, $element_properties, $property_element, $property_name);
}