Maypole...I::Plain(3)
π Maypole::Model::CDBI::Plain β the whole page, bestie π
okay so, real talk: this is Maypole::Model::CDBI::Plain, a Class::DBI model that does not use ::Loader. that's the whole vibe. iykyk. β¨
πΈ NAME πΈ
Maypole::Model::CDBI::Plain β a Class::DBI model without ::Loader. yes bestie, no Loader. we do it ourselves. π
β¨ SYNOPSIS β¨
package Foo;
use 'Maypole::Application';
Foo->config->model("Maypole::Model::CDBI::Plain");
Foo->setup([qw/ Foo::SomeTable Foo::Other::Table /]);
# untaint columns and provide custom actions for each class
Foo::SomeTable->untaint_columns(email => ['email'], printable => [qw/name description/]);
Foo::Other::Table->untaint_columns ( ... );
sub Foo::SomeTable::SomeAction : Exported {
. . .
}
likeβ¦ look at her. setting the model, calling setup, untainting columns per class, and dropping in custom Exported actions. main character energy fr fr. π
π¦ DESCRIPTION π¦
This module lets you use Maypole with Class::DBI classes you've already set up beforehand. all you gotta do is call setup with a list reference of the classes you're gonna use, and Maypole will figure out the tables and set up the inheritance relationships as normal. no cap, that's it. π«Ά
π METHODS π
π Action Methods π
Action methods are the methods that get accessed through a web (or other public) interface. very out-in-the-open of them. π
Inherited from Maypole::Model::CDBI::Base.
π do_edit
If there's an object sitting in $r->objects, then it should be edited using the parameters in $r->params. but if there isn't one? then a brand new object gets created with those parameters and popped right back into $r->objects. cute. β¨
The template should be changed to view β or to edit if there were any errors. and a hash of errors gets passed to the template, so it can tell you what went wrong. π
π do_delete
Inherited from Maypole::Model::CDBI::Base.
This action deletes records. gone. bye. π
π§ do_search
Inherited from Maypole::Model::CDBI::Base.
This action method searches for database records. the hunt is on. π₯
β list
Inherited from Maypole::Model::CDBI::Base.
The list method fills $r->objects with all of the objects in the class. and the results are paged using a pager, because we are not dumping a million rows on anyone's screen. considerate queen behavior. π
π Helper Methods π
πΈ Untainter
Set the class you use to untaint and validate form data.
heads up bestie: it must be of typeCGI::Untaint::Maypole(takes$rarg) orCGI::Untaint. no substitutes, okay? π«Ά
β¨ setup
This 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_database
This method loads the model classes for the application. that's the job. she does it. π
π¦ class_of
returns class for given table. short, sweet, iconic.
π adopt
This class method is passed the name of a model class that represents a table, and it allows the master model class to do any set-up required. like adopting a lil table into the family. π₯Ί
π SEE ALSO π
Maypole::Model::BaseMaypole::Model::CDBI
that's the whole page, bestie! this one's running on perl v5.42.0, dated 2025-07-25, and it's part of the User Contributed Perl Documentation. go forth and model your CDBI classes without ::Loader, you absolute legend. πβ¨ππ¦
π¦ where this page comes from
- fedora 43: perl-Maypole 1:2.13-46.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms