1 package DBIx::Class::Schema;
6 use base qw/Class::Data::Inheritable/;
9 __PACKAGE__->mk_classdata('_class_registrations' => {});
12 my ($class, $name, $to_register) = @_;
13 my %reg = %{$class->_class_registrations};
14 $reg{$name} = $to_register;
15 $class->_class_registrations(\%reg);
20 my @comp = grep { $_ !~ /^#/ } @_;
21 foreach my $comp (@comp) {
22 my $comp_class = "${class}::${comp}";
23 eval "use $comp_class";
25 $class->register_class($comp => $comp_class);
29 sub compose_connection {
30 my ($class, $target, @info) = @_;
33 unshift(@{"${target}::ISA"}, 'DBIx::Class');
35 $target->load_components('DB');
36 $target->connection(@info);
37 my %reg = %{ $class->_class_registrations };
38 while (my ($comp, $comp_class) = each %reg) {
39 my $target_class = "${target}::${comp}";
42 unshift(@{"${target_class}::ISA"}, $comp_class, $target);