FormValidator::Simple::Plugin::CDBI::Unique - unique check for CDBI
use FormValidator::Simple qw/CDBI::Unique/; # check single column FormValidator::Simple->check( $q => [ name => [ [qw/CDBI_UNIQUE TableClass name/] ], ] ); # check multiple columns FormValidator::Simple->check( $q => [ { unique => [qw/name email/] } => [ [qw/CDBI_UNIQUE TableClass name mail/] ], ] ); # check multiple columns including '!=' check # set "!" as prefix for key-name FormValidator::Simple->check( $q => [ { unique => [qw/id name email/] } => [ [qw/CDBI_UNIQUE Table !id name mail/] ] ] ); # when the class name is too long... FormValidator::Simple->check( $q => [ name => [ [qw/CDBI_UNIQUE MyProj::Model::User name/] ], ] ); # you can set cdbi_base_class in option. FormValidator::Simple->set_option( cdbi_base_class => 'MyProj::Model' ); FormValidator::Simple->check( $q => [ name => [ [qw/CDBI_UNIQUE User name/] ], ] );
This module is a plugin for FormValidator::Simple. This provides you a validation for unique check with CDBI table class.
FormValidator::Simple
Lyo Kato <lyo.kato@gmail.com>
Basic Idea: Masahiro Nagano <kazeburo@gmail.com>
Copyright (C) 2005 by Lyo Kato
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install FormValidator::Simple::Plugin::CDBI::Unique, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FormValidator::Simple::Plugin::CDBI::Unique
CPAN shell
perl -MCPAN -e shell install FormValidator::Simple::Plugin::CDBI::Unique
For more information on module installation, please visit the detailed CPAN module installation guide.