function 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.

Return value

bool Whether or not the argument validates.

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 1111

Class

views_handler_argument
Base class for arguments.

Code

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