function views_handler_argument::validate_argument_basic

3.x views_handler_argument.inc views_handler_argument::validate_argument_basic($arg)
2.x views_handler_argument.inc views_handler_argument::validate_argument_basic($arg)

Provide a basic argument validation.

This can be overridden for more complex types; the basic validator only checks to see if the argument is not NULL or is numeric if the definition says it's numeric.

2 calls to views_handler_argument::validate_argument_basic()
views_handler_argument::validate_arg in handlers/views_handler_argument.inc
Validate that this argument works. By default, all arguments are valid.
views_handler_argument_null::validate_argument_basic in handlers/views_handler_argument_null.inc
Provide a basic argument validation.
1 method overrides views_handler_argument::validate_argument_basic()

File

handlers/views_handler_argument.inc, line 1024
@todo.

Class

views_handler_argument
Base class for arguments.

Code

function validate_argument_basic($arg) {
  if (!isset($arg) || $arg === '') {
    return FALSE;
  }

  if (!empty($this->definition['numeric']) && !isset($this->options['break_phrase']) && !is_numeric($arg)) {
    return FALSE;
  }

  return TRUE;
}