Validator::Custom::Result

NAME

Validator::Custom::Result - Validator::Custom result object

SYNOPSYS

# Error message
@errors = $result->errors;

# A Error message
$error = $result->error('title');

# Invalid keys
@invalid_keys = $result->invalid_keys;

# Producted values
$products = $result->products;
$product  = $products->{key1};

# Is it valid all?
$is_valid = $result->is_valid;

# Is it valid a value
$is_valid = $result->is_valid('title');

Accessors

products

Set and get producted values

$result   = $result->products($products);
$products = $result->products;

$product = $products->{key};

Methods

is_valid

Check if invalid_keys exsits

$is_valid = $result->is_valid;

You can specify a key to check if that key is invalid.

$is_valid = $result->is_valid('title');

errors

Get error messages

$errors = $result->errors;
@errors = $result->errors;

error

Get error message corresponding to a key.

$error = $result->error('title');

invalid_keys

Get invalid keys

@invalid_keys = $result->invalid_keys;
$invalid_keys = $result->invalid_keys;

See also

Validator::Custom