# it on the basis of the comments in Class::C3, the author was on #dbix-class
# while I was implementing this.
- my $table = { Class::C3::_dump_MRO_table };
- eval "package $target; import Class::C3;" unless exists $table->{$target};
+ eval "package $target; import Class::C3;" unless exists $Class::C3::MRO{$target};
}
sub load_components {
sub register_source {
my ($self, $moniker, $source) = @_;
- my %reg = %{$self->source_registrations};
- $reg{$moniker} = $source;
- $self->source_registrations(\%reg);
+ $self->source_registrations->{$moniker} = $source;
$source->schema($self);
weaken($source->{schema}) if ref($self);
if ($source->result_class) {
- my %map = %{$self->class_mappings};
- $map{$source->result_class} = $moniker;
- $self->class_mappings(\%map);
+ $self->class_mappings->{$source->result_class} = $moniker;
}
}
sub compose_namespace {
my ($self, $target, $base) = @_;
- my %reg = %{ $self->source_registrations };
- my %target;
- my %map;
my $schema = $self->clone;
{
no warnings qw/redefine/;