3 namespace Drupal\views\Plugin\views\argument_validator;
5 use Drupal\Core\Plugin\Context\ContextDefinition;
8 * Validate whether an argument is numeric or not.
10 * @ingroup views_argument_validate_plugins
12 * @ViewsArgumentValidator(
14 * title = @Translation("Numeric")
17 class NumericArgumentValidator extends ArgumentValidatorPluginBase {
19 public function validateArgument($argument) {
20 return is_numeric($argument);
26 public function getContextDefinition() {
27 return new ContextDefinition('integer', $this->argument->adminLabel(), FALSE);