X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FModel%2FCDBI%2FPlain.pm;h=0dee774b9813ef34dd37df9bb6c9d668aea78338;hb=d3a3498e58b23918b3311da94f706bbfe2a576ee;hp=2c2d869a51679f24188cdddfb2ecafd8e59ba8f3;hpb=1ac110f4ecb782e381db456a3326ff71cb96a73e;p=maypole.git diff --git a/lib/Maypole/Model/CDBI/Plain.pm b/lib/Maypole/Model/CDBI/Plain.pm index 2c2d869..0dee774 100644 --- a/lib/Maypole/Model/CDBI/Plain.pm +++ b/lib/Maypole/Model/CDBI/Plain.pm @@ -1,5 +1,8 @@ package Maypole::Model::CDBI::Plain; use base 'Maypole::Model::CDBI'; +use strict; + +Maypole::Config->mk_accessors(qw(table_to_class)); sub setup_database { my ( $self, $config, $namespace, $classes ) = @_; @@ -26,15 +29,27 @@ Maypole::Model::CDBI::Plain - Class::DBI model without ::Loader use Foo::SomeTable; use Foo::Other::Table; - Foo->config->{model_class} = "Maypole::Model::CDBI::Plain"; + Foo->config->model("Maypole::Model::CDBI::Plain"); Foo->setup([qw/ Foo::SomeTable Foo::Other::Table /]); =head1 DESCRIPTION This module allows you to use Maypole with previously set-up -C classes; simply call C with a list reference +L classes; simply call C with a list reference of the classes you're going to use, and Maypole will work out the tables and set up the inheritance relationships as normal. +=head1 METHODS + +=over 4 + +=item setup_database + +=item class_of + +=back + +See L + =cut