8e8c96571f287b9749804ae33c7330505bf9e9ca
[yaffs-website] / web / core / modules / views / src / Plugin / views / argument_validator / None.php
1 <?php
2
3 namespace Drupal\views\Plugin\views\argument_validator;
4
5 /**
6  * Do not validate the argument.
7  *
8  * @ingroup views_argument_validate_plugins
9  *
10  * @ViewsArgumentValidator(
11  *   id = "none",
12  *   title = @Translation(" - Basic validation - ")
13  * )
14  */
15 class None extends ArgumentValidatorPluginBase {
16
17   public function validateArgument($argument) {
18     if (!empty($this->argument->options['must_not_be'])) {
19       return !isset($argument);
20     }
21
22     if (!isset($argument) || $argument === '') {
23       return FALSE;
24     }
25
26     if (!empty($this->argument->definition['numeric']) && !isset($this->argument->options['break_phrase']) && !is_numeric($arg)) {
27       return FALSE;
28     }
29
30     return TRUE;
31   }
32
33 }