Validator::Custom::Result
NAME
Validator::Custom::Result - Validator::Custom validation result
SYNOPSYS
# All error messages
@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 All data valid?
$is_valid = $result->is_valid;
# Is a data valid?
$is_valid = $result->is_valid('title');
ATTRIBUTES
products
Producted values
$result = $result->products($products);
$products = $result->products;
error_infos
Error infos
$result = $result->error_infos($error_infos);
$error_infos = $result->error_infos;
METHODS
add_error_info
Add error informations
$result->add_error_info($error_info);
Sample
$result->add_error_info({invalid_key => $product_key,
message => $message});
is_valid
Check if result is valid.
$is_valid = $result->is_valid;
Check if the data corresponding to the key is valid.
$is_valid = $result->is_valid('title');
error
Get error message corresponding to a key.
$error = $result->error('title');
errors
Get all error messages
$errors = $result->errors;
@errors = $result->errors;
error_reason
Get error reason. this is same as constraint name.
$error_reason = $result->error_reason($key);
invalid_keys
Get invalid keys
@invalid_keys = $result->invalid_keys;
$invalid_keys = $result->invalid_keys;
remove_error_info
Remove error information
$result->remove_error_info($key);