From: Matt S Trout Date: Thu, 4 Aug 2005 17:47:54 +0000 (+0000) Subject: Couple extra tweaks to Schema to support proposed C::M::DBIC X-Git-Tag: v0.03001~69 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=74b92d9a6f3501f2db4e612da228b5debb33ac30;p=dbsrgits%2FDBIx-Class.git Couple extra tweaks to Schema to support proposed C::M::DBIC --- diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index 3154555..72928fc 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -6,7 +6,7 @@ use warnings; use base qw/Class::Data::Inheritable/; use DBIx::Class; -__PACKAGE__->mk_classdata('_class_registrations' => {}); +__PACKAGE__->mk_classdata('class_registrations' => {}); =head1 NAME @@ -51,9 +51,13 @@ DBIx::Class::Schema - composable schemas sub register_class { my ($class, $name, $to_register) = @_; - my %reg = %{$class->_class_registrations}; + my %reg = %{$class->class_registrations}; $reg{$name} = $to_register; - $class->_class_registrations(\%reg); + $class->class_registrations(\%reg); +} + +sub registered_classes { + return values %{shift->class_registrations}; } sub load_classes { @@ -70,7 +74,7 @@ sub load_classes { sub compose_connection { my ($class, $target, @info) = @_; $class->setup_connection_class($target, @info); - my %reg = %{ $class->_class_registrations }; + my %reg = %{ $class->class_registrations }; while (my ($comp, $comp_class) = each %reg) { my $target_class = "${target}::${comp}"; $class->inject_base($target_class, $comp_class, $target);