function views_handler_argument::validate_argument_basic

Same name in other branches
  1. 7.x-3.x handlers/views_handler_argument.inc \views_handler_argument::validate_argument_basic()

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()
views_handler_argument_null::validate_argument_basic in handlers/views_handler_argument_null.inc
Provide a basic argument validation.

File

handlers/views_handler_argument.inc, line 770

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;
}