You are here

public function SqlBase::exposedFormValidate in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Plugin/views/pager/SqlBase.php \Drupal\views\Plugin\views\pager\SqlBase::exposedFormValidate()

Overrides PagerPluginBase::exposedFormValidate

File

core/modules/views/src/Plugin/views/pager/SqlBase.php, line 367
Contains \Drupal\views\Plugin\views\pager\SqlBase.

Class

SqlBase
A common base class for sql based pager.

Namespace

Drupal\views\Plugin\views\pager

Code

public function exposedFormValidate(&$form, FormStateInterface $form_state) {
  if (!$form_state
    ->isValueEmpty('offset') && trim($form_state
    ->getValue('offset'))) {
    if (!is_numeric($form_state
      ->getValue('offset')) || $form_state
      ->getValue('offset') < 0) {
      $form_state
        ->setErrorByName('offset', $this
        ->t('Offset must be an number greater or equal than 0.'));
    }
  }
}