sub setup_database {
my ( $self, $config, $namespace, $classes ) = @_;
$config->{classes} = $classes;
sub setup_database {
my ( $self, $config, $namespace, $classes ) = @_;
$config->{classes} = $classes;
$config->{table_to_class} = { map { $_->table => $_ } @$classes };
$config->{tables} = [ keys %{ $config->{table_to_class} } ];
}
$config->{table_to_class} = { map { $_->table => $_ } @$classes };
$config->{tables} = [ keys %{ $config->{table_to_class} } ];
}
Foo->setup([qw/ Foo::SomeTable Foo::Other::Table /]);
=head1 DESCRIPTION
This module allows you to use Maypole with previously set-up
Foo->setup([qw/ Foo::SomeTable Foo::Other::Table /]);
=head1 DESCRIPTION
This module allows you to use Maypole with previously set-up
of the classes you're going to use, and Maypole will work out the
tables and set up the inheritance relationships as normal.
of the classes you're going to use, and Maypole will work out the
tables and set up the inheritance relationships as normal.