Maypole...I::Plain(3)

πŸ“¦
version 2.13 Β· 2 versions
, in fedora 43

πŸ’– 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. πŸ’€


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 type CGI::Untaint::Maypole (takes $r arg) or CGI::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::Base
  • Maypole::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