|
NAMEMaypole::Model::CDBI - Model class based on Class::DBIDESCRIPTIONThis is a master model class which uses Class::DBI to do all the hard work of fetching rows and representing them as objects. It is a good model to copy if you're replacing it with other database abstraction modules.It implements a base set of methods required for a Maypole Data Model. It inherits accessor and helper methods from Maypole::Model::Base. When specified as the application model, it will use Class::DBI::Loader to generate the model classes from the provided database. If you do not wish to use this functionality, use Maypole::Model::CDBI::Plain which will instead use Class::DBI classes provided. UntainterSet the class you use to untaint and validate form data Note it must be of type CGI::Untaint::Maypole (takes $r arg) or CGI::Untaintadd_model_superclassAdds model as superclass to model classes (if necessary)Inherited from Maypole::Model::CDBI::Base Action MethodsAction methods are methods that are accessed through web (or other public) interface.Inherited from Maypole::Model::CDBI::Base do_editIf there is an object in "$r->objects", then it should be edited with the parameters in "$r->params"; otherwise, a new object should be created with those parameters, and put back into "$r->objects". The template should be changed to "view", or "edit" if there were any errors. A hash of errors will be passed to the template.do_deleteInherited from Maypole::Model::CDBI::Base.This action deletes records do_searchInherited from Maypole::Model::CDBI::Base.This action method searches for database records. listInherited from Maypole::Model::CDBI::Base.The "list" method fills "$r->objects" with all of the objects in the class. The results are paged using a pager. Helper MethodssetupThis method is inherited from Maypole::Model::Base and calls setup_database, which uses Class::DBI::Loader to create and load Class::DBI classes from the given database schema. setup_databaseThe $opts argument is a hashref of options. The "options" key is a hashref of Database connection options . Other keys may be various Loader arguments or flags. It has this form: { # DB connection options options { AutoCommit => 1 , ... }, # Loader args relationships => 1, ... }class_ofreturns class for given table SEE ALSOMaypole, Maypole::Model::CDBI::Base.AUTHORMaypole is currently maintained by Aaron Trevena.AUTHOR EMERITUSSimon Cozens, "simon#cpan.org"Simon Flack maintained Maypole from 2.05 to 2.09 Sebastian Riedel, "sri#oook.de" maintained Maypole from 1.99_01 to 2.04 LICENSEYou may distribute this code under the same terms as Perl itself.
Visit the GSP FreeBSD Man Page Interface. |