X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FModel%2FCDBI%2FPlain.pm;h=0ca9bc972931e6277f1ca08a4540336c6615644d;hb=dcc33148f1b562834e16f658e34270f3f581833c;hp=c95bead3babdd720fb2f76f1ac8096076f94c785;hpb=ce828f4b7309670fc8b0ed826fd2455c4d5412bb;p=maypole.git diff --git a/lib/Maypole/Model/CDBI/Plain.pm b/lib/Maypole/Model/CDBI/Plain.pm index c95bead..0ca9bc9 100644 --- a/lib/Maypole/Model/CDBI/Plain.pm +++ b/lib/Maypole/Model/CDBI/Plain.pm @@ -1,11 +1,6 @@ package Maypole::Model::CDBI::Plain; -use Class::C3; -use Maypole::Config; -use base 'Maypole::Model::CDBI'; use strict; -Maypole::Config->mk_accessors(qw(table_to_class)); - =head1 NAME Maypole::Model::CDBI::Plain - Class::DBI model without ::Loader @@ -37,8 +32,62 @@ L classes; simply call C with a list reference of the classes you're going to use, and Maypole will work out the tables and set up the inheritance relationships as normal. +=cut + +use Class::C3; +use Maypole::Config; +use base 'Maypole::Model::CDBI::Base'; + +use Maypole::Model::CDBI::AsForm; +use Maypole::Model::CDBI::FromCGI; +use CGI::Untaint::Maypole; + =head1 METHODS +=head1 Action Methods + +Action methods are methods that are accessed through web (or other public) interface. + +Inherited from L + +=head2 do_edit + +If there is an object in C<$r-Eobjects>, then it should be edited +with the parameters in C<$r-Eparams>; otherwise, a new object should +be created with those parameters, and put back into C<$r-Eobjects>. +The template should be changed to C, or C if there were any +errors. A hash of errors will be passed to the template. + +=head2 do_delete + +Inherited from Maypole::Model::CDBI::Base. + +This action deletes records + +=head2 do_search + +Inherited from Maypole::Model::CDBI::Base. + +This action method searches for database records. + +=head2 list + +Inherited from Maypole::Model::CDBI::Base. + +The C method fills C<$r-Eobjects> with all of the +objects in the class. The results are paged using a pager. + +=head1 Helper Methods + +=head2 Untainter + +Set the class you use to untaint and validate form data +Note it must be of type CGI::Untaint::Maypole (takes $r arg) or CGI::Untaint + +=cut + +sub Untainter { 'CGI::Untaint::Maypole' }; + =head2 setup This method is inherited from Maypole::Model::Base and calls setup_database, @@ -51,8 +100,6 @@ tables and set up the inheritance relationships as normal. =cut - - sub setup_database { my ( $self, $config, $namespace, $classes ) = @_; $config->{classes} = $classes;