You are here

public function CoreSearchService::configurationFormValidate in Fast Autocomplete 7

Implements SearchServiceInterface::configurationFormValidate().

Overrides AbstractSearchService::configurationFormValidate

File

src/SearchService/CoreSearchService.php, line 66

Class

CoreSearchService
Fast Autocomplete backend service class providing Drupal core search.

Namespace

Drupal\fac\SearchService

Code

public function configurationFormValidate(array $form, array &$values, array &$form_state) {
  if ($values['number_of_results'] > 10) {
    form_set_error('number_of_results', t('Core search is limited to a maximum of 10 results.'));
  }
  if ($values['number_of_results'] < 1) {
    form_set_error('number_of_results', t('Please enter a maximum number of results of 1 or more.'));
  }
}