From: Matt S Trout Date: Fri, 30 Dec 2005 04:52:21 +0000 (+0000) Subject: compose_namespace, just for claco. who by asking volunteered to document it. clearly. X-Git-Tag: v0.05005~119^2~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e678398e92ba03be930680d9aa75c96c65280500;p=dbsrgits%2FDBIx-Class.git compose_namespace, just for claco. who by asking volunteered to document it. clearly. --- diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index e2643f0..0d6bec8 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -167,12 +167,17 @@ sub compose_connection { my ($class, $target, @info) = @_; my $conn_class = "${target}::_db"; $class->setup_connection_class($conn_class, @info); + $class->compose_namespace($target, $conn_class); +} + +sub compose_namespace { + my ($class, $target, $base) = @_; my %reg = %{ $class->class_registrations }; my %target; my %map; while (my ($comp, $comp_class) = each %reg) { my $target_class = "${target}::${comp}"; - $class->inject_base($target_class, $comp_class, $conn_class); + $class->inject_base($target_class, $comp_class, $base); @map{$comp, $comp_class} = ($target_class, $target_class); } { @@ -184,7 +189,7 @@ sub compose_connection { }; *{"${target}::classes"} = sub { return \%map; }; } - $conn_class->class_resolver($target); + $base->class_resolver($target); } =head2 setup_connection_class <$target> <@info>