1Maypole::Model::CDBI(3)User Contributed Perl DocumentatioMnaypole::Model::CDBI(3)
2
3
4

NAME

6       Maypole::Model::CDBI - Model class based on Class::DBI
7

DESCRIPTION

9       This is a master model class which uses Class::DBI to do all the hard
10       work of fetching rows and representing them as objects. It is a good
11       model to copy if you're replacing it with other database abstraction
12       modules.
13
14       It implements a base set of methods required for a Maypole Data Model.
15
16       It inherits accessor and helper methods from Maypole::Model::Base.
17
18       When specified as the application model, it will use Class::DBI::Loader
19       to generate the model classes from the provided database. If you do not
20       wish to use this functionality, use Maypole::Model::CDBI::Plain which
21       will instead use Class::DBI classes provided.
22
23   Untainter
24       Set the class you use to untaint and validate form data Note it must be
25       of type CGI::Untaint::Maypole (takes $r arg) or CGI::Untaint
26
27   add_model_superclass
28       Adds model as superclass to model classes (if necessary)
29
30       Inherited from Maypole::Model::CDBI::Base
31

Action Methods

33       Action methods are methods that are accessed through web (or other
34       public) interface.
35
36       Inherited from Maypole::Model::CDBI::Base
37
38   do_edit
39       If there is an object in "$r->objects", then it should be edited with
40       the parameters in "$r->params"; otherwise, a new object should be
41       created with those parameters, and put back into "$r->objects".  The
42       template should be changed to "view", or "edit" if there were any
43       errors. A hash of errors will be passed to the template.
44
45   do_delete
46       Inherited from Maypole::Model::CDBI::Base.
47
48       This action deletes records
49
50   do_search
51       Inherited from Maypole::Model::CDBI::Base.
52
53       This action method searches for database records.
54
55   list
56       Inherited from Maypole::Model::CDBI::Base.
57
58       The "list" method fills "$r->objects" with all of the objects in the
59       class. The results are paged using a pager.
60

Helper Methods

62   setup
63         This method is inherited from Maypole::Model::Base and calls setup_database,
64         which uses Class::DBI::Loader to create and load Class::DBI classes from
65         the given database schema.
66
67   setup_database
68       The $opts argument is a hashref of options.  The "options" key is a
69       hashref of Database connection options . Other keys may be various
70       Loader arguments or flags.  It has this form:
71        {
72          # DB connection options
73          options { AutoCommit => 1 , ... },
74          # Loader args
75          relationships => 1,
76          ...
77        }
78
79   class_of
80         returns class for given table
81

SEE ALSO

83       Maypole, Maypole::Model::CDBI::Base.
84

AUTHOR

86       Maypole is currently maintained by Aaron Trevena.
87

AUTHOR EMERITUS

89       Simon Cozens, "simon#cpan.org"
90
91       Simon Flack maintained Maypole from 2.05 to 2.09
92
93       Sebastian Riedel, "sri#oook.de" maintained Maypole from 1.99_01 to 2.04
94

LICENSE

96       You may distribute this code under the same terms as Perl itself.
97
98
99
100perl v5.38.0                      2023-07-20           Maypole::Model::CDBI(3)
Impressum