NAME
Handel::Components::Validation - Column validation for schemas
SYNOPSIS
package MySchema::Table;
use strict;
use warnings;
use base qw/DBIx::Class/;
__PACKAGE__->load_components('+Handel::Component::Validation');
__PACKAGE__->validation(
module => 'FormValidator::Simple',
profile => [ ... ],
auto => 1
);
1;
DESCRIPTION
Handel::Components::Validation is a customized version of DBIx::Class::Validation for use in cart/order schemas.
There is no real reason to load this component into your schema table classes directly. If you set a profile using Handel::Storage->validation_profile, this component will be loaded into the appropriate schema source class automatically.
If validation fails, a Handel::Exception::Validation will be thrown containing the the result object returned from the validation module.
validate
Validates the data using the specified validation module/profile. If validation succeeds, the result object from the validation module is returned. If validation fails, a Handel:Exception::Validation will be thrown.
throw_exception
Wraps DBIx::Class::Validation exceptions in Handel exceptions and rethrows. See "throw_exception" in DBIx::Class::Row for more information about throw_exception.
SEE ALSO
DBIx::Class::Validation, FormValidator::Simple
AUTHOR
Christopher H. Laco
CPAN ID: CLACO
claco@chrislaco.com
http://today.icantfocus.com/blog/