This method loads the model classes for the application
-=head1 SEE ALSO
-
-L<Maypole::Model::Base>
-
-L<Maypole::Model::CDBI>
-
=cut
+
sub setup_database {
my ( $self, $config, $namespace, $classes ) = @_;
$config->{classes} = $classes;
$config->{tables} = [ keys %{ $config->{table_to_class} } ];
}
+=head2 class_of
+
+ returns class for given table
+
+=cut
+
sub class_of {
my ( $self, $r, $table ) = @_;
return $r->config->{table_to_class}->{$table};
}
+=head2 adopt
+
+This class method is passed the name of a model class that represensts a table
+and allows the master model class to do any set-up required.
+
+=cut
+
+sub adopt {
+ my ( $self, $child ) = @_;
+ if ( my $col = $child->stringify_column ) {
+ $child->columns( Stringify => $col );
+ }
+}
+
+=head1 SEE ALSO
+
+L<Maypole::Model::Base>
+
+L<Maypole::Model::CDBI>
+
+=cut
+
1;