1Maypole::Model::CDBI::PUlsaeirn(C3o)ntributed Perl DocumMeanytpaotlieo:n:Model::CDBI::Plain(3)
2
3
4
6 Maypole::Model::CDBI::Plain - Class::DBI model without ::Loader
7
9 package Foo;
10 use 'Maypole::Application';
11
12 Foo->config->model("Maypole::Model::CDBI::Plain");
13 Foo->setup([qw/ Foo::SomeTable Foo::Other::Table /]);
14
15 # untaint columns and provide custom actions for each class
16
17 Foo::SomeTable->untaint_columns(email => ['email'], printable => [qw/name description/]);
18
19 Foo::Other::Table->untaint_columns ( ... );
20
21 sub Foo::SomeTable::SomeAction : Exported {
22
23 . . .
24
25 }
26
28 This module allows you to use Maypole with previously set-up Class::DBI
29 classes; simply call "setup" with a list reference of the classes
30 you're going to use, and Maypole will work out the tables and set up
31 the inheritance relationships as normal.
32
35 Action methods are methods that are accessed through web (or other
36 public) interface.
37
38 Inherited from Maypole::Model::CDBI::Base
39
40 do_edit
41 If there is an object in "$r->objects", then it should be edited with
42 the parameters in "$r->params"; otherwise, a new object should be
43 created with those parameters, and put back into "$r->objects". The
44 template should be changed to "view", or "edit" if there were any
45 errors. A hash of errors will be passed to the template.
46
47 do_delete
48 Inherited from Maypole::Model::CDBI::Base.
49
50 This action deletes records
51
52 do_search
53 Inherited from Maypole::Model::CDBI::Base.
54
55 This action method searches for database records.
56
57 list
58 Inherited from Maypole::Model::CDBI::Base.
59
60 The "list" method fills "$r->objects" with all of the objects in the
61 class. The results are paged using a pager.
62
64 Untainter
65 Set the class you use to untaint and validate form data Note it must be
66 of type CGI::Untaint::Maypole (takes $r arg) or CGI::Untaint
67
68 setup
69 This method is inherited from Maypole::Model::Base and calls setup_database,
70 which uses Class::DBI::Loader to create and load Class::DBI classes from
71 the given database schema.
72
73 setup_database
74 This method loads the model classes for the application
75
76 class_of
77 returns class for given table
78
79 adopt
80 This class method is passed the name of a model class that represensts
81 a table and allows the master model class to do any set-up required.
82
84 Maypole::Model::Base
85
86 Maypole::Model::CDBI
87
88
89
90perl v5.36.0 2023-01-20 Maypole::Model::CDBI::Plain(3)