From c38178130074637da021d64e139696422496ab0e Mon Sep 17 00:00:00 2001 From: Aaron Trevena Date: Sun, 22 Oct 2006 19:19:02 +0000 Subject: [PATCH] added dfv check method to DFV model git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@535 48953598-375a-da11-a14b-00016c27c3ee --- lib/Maypole/Model/CDBI/DFV.pm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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); -- 2.39.5