You are here

protected function DateBase::prepareElementValidateCallbacks in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElement/DateBase.php \Drupal\webform\Plugin\WebformElement\DateBase::prepareElementValidateCallbacks()

Prepare an element's validation callbacks.

Parameters

array $element: An element.

\Drupal\webform\WebformSubmissionInterface $webform_submission: A webform submission.

Overrides WebformElementBase::prepareElementValidateCallbacks

File

src/Plugin/WebformElement/DateBase.php, line 134

Class

DateBase
Provides a base 'date' class.

Namespace

Drupal\webform\Plugin\WebformElement

Code

protected function prepareElementValidateCallbacks(array &$element, WebformSubmissionInterface $webform_submission = NULL) {
  $element['#element_validate'] = array_merge([
    [
      get_class($this),
      'preValidateDate',
    ],
  ], $element['#element_validate']);
  $element['#element_validate'][] = [
    get_class($this),
    'validateDate',
  ];
  parent::prepareElementValidateCallbacks($element, $webform_submission);
}