You are here

function None::validate_argument in Views (for Drupal 7) 8.3

Overrides ArgumentValidatorPluginBase::validate_argument

File

lib/Drupal/views/Plugin/views/argument_validator/None.php, line 25
Definition of Drupal\views\Plugin\views\argument_validator\None.

Class

None
Do not validate the argument.

Namespace

Drupal\views\Plugin\views\argument_validator

Code

function validate_argument($argument) {
  if (!empty($this->argument->options['must_not_be'])) {
    return !isset($argument);
  }
  if (!isset($argument) || $argument === '') {
    return FALSE;
  }
  if (!empty($this->argument->definition['numeric']) && !isset($this->argument->options['break_phrase']) && !is_numeric($arg)) {
    return FALSE;
  }
  return TRUE;
}