From: Aaron Trevena Date: Sun, 22 Oct 2006 19:19:02 +0000 (+0000) Subject: added dfv check method to DFV model X-Git-Tag: 2.12~39 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=c38178130074637da021d64e139696422496ab0e;p=maypole.git added dfv check method to DFV model git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@535 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/lib/Maypole/Model/CDBI/DFV.pm b/lib/Maypole/Model/CDBI/DFV.pm index 5c7a127..eb2bf20 100644 --- a/lib/Maypole/Model/CDBI/DFV.pm +++ b/lib/Maypole/Model/CDBI/DFV.pm @@ -96,6 +96,21 @@ sub adopt { } } +=head2 check_params + + Checks parameters against the DFV profile for the class, returns the results + of DFV's check. + + my $dfv_results = __PACKAGE__->check_params($r->params); + +=cut + +sub check_params { + my ($class,$params) = @_; + return Data::FormValidator->check($params, $class->dfv_profile); +} + + =head1 Action Methods Action methods are methods that are accessed through web (or other public) interface. @@ -125,7 +140,6 @@ sub do_edit : Exported { return; } - my $required_cols = $class->required_columns; my $errors; if ($obj) { ($obj,$errors) = $class->_do_update($r,$obj);