From: Matt S Trout Date: Tue, 15 Nov 2005 09:05:09 +0000 (+0000) Subject: Broke everything (C3 branch) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=147dd158cf91465b8a48adce738d56b85f7d1b9b;p=dbsrgits%2FDBIx-Class-Historic.git Broke everything (C3 branch) --- diff --git a/lib/DBIx/Class/CDBICompat/AccessorMapping.pm b/lib/DBIx/Class/CDBICompat/AccessorMapping.pm index 2489d3f..e1300a3 100644 --- a/lib/DBIx/Class/CDBICompat/AccessorMapping.pm +++ b/lib/DBIx/Class/CDBICompat/AccessorMapping.pm @@ -8,7 +8,7 @@ use NEXT; sub mk_group_accessors { my ($class, $group, @cols) = @_; unless ($class->can('accessor_name') || $class->can('mutator_name')) { - return $class->NEXT::ACTUAL::mk_group_accessors($group => @cols); + return $class->next::method($group => @cols); } foreach my $col (@cols) { my $ro_meth = ($class->can('accessor_name') @@ -19,7 +19,7 @@ sub mk_group_accessors { : $col); #warn "$col $ro_meth $wo_meth"; if ($ro_meth eq $wo_meth) { - $class->NEXT::ACTUAL::mk_group_accessors($group => [ $ro_meth => $col ]); + $class->next::method($group => [ $ro_meth => $col ]); } else { $class->mk_group_ro_accessors($group => [ $ro_meth => $col ]); $class->mk_group_wo_accessors($group => [ $wo_meth => $col ]); @@ -43,7 +43,7 @@ sub create { $att{$col} = delete $attrs->{$mut} if exists $attrs->{$mut}; } } - return $class->NEXT::ACTUAL::create({ %$attrs, %att }, @rest); + return $class->next::method({ %$attrs, %att }, @rest); } 1; diff --git a/lib/DBIx/Class/CDBICompat/AutoUpdate.pm b/lib/DBIx/Class/CDBICompat/AutoUpdate.pm index fb33a0a..10076c6 100644 --- a/lib/DBIx/Class/CDBICompat/AutoUpdate.pm +++ b/lib/DBIx/Class/CDBICompat/AutoUpdate.pm @@ -9,7 +9,7 @@ __PACKAGE__->mk_classdata('__AutoCommit'); sub set_column { my $self = shift; - my $ret = $self->NEXT::set_column(@_); + my $ret = $self->next::method(@_); $self->update if ($self->autoupdate && $self->{_in_storage}); return $ret; } diff --git a/lib/DBIx/Class/CDBICompat/ColumnCase.pm b/lib/DBIx/Class/CDBICompat/ColumnCase.pm index 4e65117..edea63a 100644 --- a/lib/DBIx/Class/CDBICompat/ColumnCase.pm +++ b/lib/DBIx/Class/CDBICompat/ColumnCase.pm @@ -6,61 +6,61 @@ use NEXT; sub _register_column_group { my ($class, $group, @cols) = @_; - return $class->NEXT::ACTUAL::_register_column_group($group => map lc, @cols); + return $class->next::method($group => map lc, @cols); } sub _register_columns { my ($class, @cols) = @_; - return $class->NEXT::ACTUAL::_register_columns(map lc, @cols); + return $class->next::method(map lc, @cols); } sub has_a { my ($class, $col, @rest) = @_; - $class->NEXT::ACTUAL::has_a(lc($col), @rest); + $class->next::method(lc($col), @rest); $class->mk_group_accessors('inflated_column' => $col); return 1; } sub has_many { my ($class, $rel, $f_class, $f_key, @rest) = @_; - return $class->NEXT::ACTUAL::has_many($rel, $f_class, ( ref($f_key) ? + return $class->next::method($rel, $f_class, ( ref($f_key) ? $f_key : lc($f_key) ), @rest); } sub get_inflated_column { my ($class, $get, @rest) = @_; - return $class->NEXT::ACTUAL::get_inflated_column(lc($get), @rest); + return $class->next::method(lc($get), @rest); } sub store_inflated_column { my ($class, $set, @rest) = @_; - return $class->NEXT::ACTUAL::store_inflated_column(lc($set), @rest); + return $class->next::method(lc($set), @rest); } sub set_inflated_column { my ($class, $set, @rest) = @_; - return $class->NEXT::ACTUAL::set_inflated_column(lc($set), @rest); + return $class->next::method(lc($set), @rest); } sub get_column { my ($class, $get, @rest) = @_; - return $class->NEXT::ACTUAL::get_column(lc($get), @rest); + return $class->next::method(lc($get), @rest); } sub set_column { my ($class, $set, @rest) = @_; - return $class->NEXT::ACTUAL::set_column(lc($set), @rest); + return $class->next::method(lc($set), @rest); } sub store_column { my ($class, $set, @rest) = @_; - return $class->NEXT::ACTUAL::store_column(lc($set), @rest); + return $class->next::method(lc($set), @rest); } sub find_column { my ($class, $col) = @_; - return $class->NEXT::ACTUAL::find_column(lc($col)); + return $class->next::method(lc($col)); } sub _mk_group_accessors { @@ -73,25 +73,25 @@ sub _mk_group_accessors { next if defined &{"${class}::${acc}"}; push(@extra, [ lc $acc => $field ]); } - return $class->NEXT::ACTUAL::_mk_group_accessors($type, $group, + return $class->next::method($type, $group, @fields, @extra); } sub _cond_key { my ($class, $attrs, $key, @rest) = @_; - return $class->NEXT::ACTUAL::_cond_key($attrs, lc($key), @rest); + return $class->next::method($attrs, lc($key), @rest); } sub _cond_value { my ($class, $attrs, $key, @rest) = @_; - return $class->NEXT::ACTUAL::_cond_value($attrs, lc($key), @rest); + return $class->next::method($attrs, lc($key), @rest); } sub new { my ($class, $attrs, @rest) = @_; my %att; $att{lc $_} = $attrs->{$_} for keys %$attrs; - return $class->NEXT::ACTUAL::new(\%att, @rest); + return $class->next::method(\%att, @rest); } 1; diff --git a/lib/DBIx/Class/CDBICompat/HasMany.pm b/lib/DBIx/Class/CDBICompat/HasMany.pm index 3f745f6..3d402b1 100644 --- a/lib/DBIx/Class/CDBICompat/HasMany.pm +++ b/lib/DBIx/Class/CDBICompat/HasMany.pm @@ -19,7 +19,7 @@ sub has_many { $args->{cascade_delete} = 0; } - $class->NEXT::has_many($rel, $f_class, $f_key, $args); + $class->next::method($rel, $f_class, $f_key, $args); if (@f_method) { no strict 'refs'; diff --git a/lib/DBIx/Class/CDBICompat/ImaDBI.pm b/lib/DBIx/Class/CDBICompat/ImaDBI.pm index b77ba18..3a17281 100644 --- a/lib/DBIx/Class/CDBICompat/ImaDBI.pm +++ b/lib/DBIx/Class/CDBICompat/ImaDBI.pm @@ -62,7 +62,7 @@ sub connection { my ($class, @info) = @_; $info[3] = { %{ $info[3] || {}} }; $info[3]->{RootClass} = 'DBIx::ContextualFetch'; - return $class->NEXT::connection(@info); + return $class->next::method(@info); } sub __driver { diff --git a/lib/DBIx/Class/CDBICompat/LazyLoading.pm b/lib/DBIx/Class/CDBICompat/LazyLoading.pm index 6a33eff..44c5b3a 100644 --- a/lib/DBIx/Class/CDBICompat/LazyLoading.pm +++ b/lib/DBIx/Class/CDBICompat/LazyLoading.pm @@ -15,7 +15,7 @@ sub get_column { && $_ ne 'All' } keys %{ $self->_column_groups || {} }); } - $self->NEXT::get_column(@_[1..$#_]); + $self->next::method(@_[1..$#_]); } sub _flesh { diff --git a/lib/DBIx/Class/CDBICompat/LiveObjectIndex.pm b/lib/DBIx/Class/CDBICompat/LiveObjectIndex.pm index 8ebdf12..7d04710 100644 --- a/lib/DBIx/Class/CDBICompat/LiveObjectIndex.pm +++ b/lib/DBIx/Class/CDBICompat/LiveObjectIndex.pm @@ -33,7 +33,7 @@ sub clear_object_index { sub insert { my ($self, @rest) = @_; - $self->NEXT::ACTUAL::insert(@rest); + $self->next::method(@rest); # Because the insert will die() if it can't insert into the db (or should) # we can be sure the object *was* inserted if we got this far. In which # case, given primary keys are unique and ID only returns a @@ -53,7 +53,7 @@ sub insert { sub _row_to_object { my ($class, @rest) = @_; - my $new = $class->NEXT::ACTUAL::_row_to_object(@rest); + my $new = $class->next::method(@rest); if (my $key = $new->ID) { #warn "Key $key"; my $live = $class->live_object_index; @@ -70,11 +70,11 @@ sub discard_changes { my ($self) = @_; if (my $key = $self->ID) { $self->remove_from_object_index; - my $ret = $self->NEXT::ACTUAL::discard_changes; + my $ret = $self->next::method; $self->live_object_index->{$key} = $self if $self->in_storage; return $ret; } else { - return $self->NEXT::ACTUAL::discard_changes; + return $self->next::method; } } diff --git a/lib/DBIx/Class/CDBICompat/MightHave.pm b/lib/DBIx/Class/CDBICompat/MightHave.pm index e661f6b..55e97e9 100644 --- a/lib/DBIx/Class/CDBICompat/MightHave.pm +++ b/lib/DBIx/Class/CDBICompat/MightHave.pm @@ -6,9 +6,9 @@ use warnings; sub might_have { my ($class, $rel, $f_class, @columns) = @_; if (ref $columns[0] || !defined $columns[0]) { - return $class->NEXT::might_have($rel, $f_class, @columns); + return $class->next::method($rel, $f_class, @columns); } else { - return $class->NEXT::might_have($rel, $f_class, undef, + return $class->next::method($rel, $f_class, undef, { proxy => \@columns }); } } diff --git a/lib/DBIx/Class/CDBICompat/TempColumns.pm b/lib/DBIx/Class/CDBICompat/TempColumns.pm index a1f7d6d..6de7fd3 100644 --- a/lib/DBIx/Class/CDBICompat/TempColumns.pm +++ b/lib/DBIx/Class/CDBICompat/TempColumns.pm @@ -15,7 +15,7 @@ sub _add_column_group { $tmp{$_} = 1 for @cols; $class->_temp_columns(\%tmp); } else { - return $class->NEXT::ACTUAL::_add_column_group($group, @cols); + return $class->next::method($group, @cols); } } @@ -25,7 +25,7 @@ sub new { foreach my $key (keys %$attrs) { $temp{$key} = delete $attrs->{$key} if $class->_temp_columns->{$key}; } - my $new = $class->NEXT::ACTUAL::new($attrs, @rest); + my $new = $class->next::method($attrs, @rest); foreach my $key (keys %temp) { $new->set_temp($key, $temp{$key}); } @@ -36,7 +36,7 @@ sub new { sub find_column { my ($class, $col, @rest) = @_; return $col if $class->_temp_columns->{$col}; - return $class->NEXT::ACTUAL::find_column($col, @rest); + return $class->next::method($col, @rest); } sub get_temp { diff --git a/lib/DBIx/Class/CDBICompat/Triggers.pm b/lib/DBIx/Class/CDBICompat/Triggers.pm index 3bf8070..0c06950 100644 --- a/lib/DBIx/Class/CDBICompat/Triggers.pm +++ b/lib/DBIx/Class/CDBICompat/Triggers.pm @@ -7,7 +7,7 @@ use Class::Trigger; sub insert { my $self = shift; $self->call_trigger('before_create'); - $self->NEXT::ACTUAL::insert(@_); + $self->next::method(@_); $self->call_trigger('after_create'); return $self; } @@ -17,7 +17,7 @@ sub update { $self->call_trigger('before_update'); my @to_update = keys %{$self->{_dirty_columns} || {}}; return -1 unless @to_update; - $self->NEXT::ACTUAL::update(@_); + $self->next::method(@_); $self->call_trigger('after_update'); return $self; } @@ -25,7 +25,7 @@ sub update { sub delete { my $self = shift; $self->call_trigger('before_delete') if ref $self; - $self->NEXT::ACTUAL::delete(@_); + $self->next::method(@_); $self->call_trigger('after_delete') if ref $self; return $self; } @@ -34,7 +34,7 @@ sub store_column { my ($self, $column, $value, @rest) = @_; my $vals = { $column => $value }; $self->call_trigger("before_set_${column}", $value, $vals); - return $self->NEXT::ACTUAL::store_column($column, $vals->{$column}); + return $self->next::method($column, $vals->{$column}); } 1; diff --git a/lib/DBIx/Class/Componentised.pm b/lib/DBIx/Class/Componentised.pm index 72dd6f2..f83bd22 100644 --- a/lib/DBIx/Class/Componentised.pm +++ b/lib/DBIx/Class/Componentised.pm @@ -1,11 +1,14 @@ package DBIx::Class::Componentised; +use Class::C3; + sub inject_base { my ($class, $target, @to_inject) = @_; { no strict 'refs'; unshift(@{"${target}::ISA"}, grep { $target ne $_ } @to_inject); } + eval "package $target; use Class::C3;"; } sub load_components { diff --git a/lib/DBIx/Class/InflateColumn.pm b/lib/DBIx/Class/InflateColumn.pm index 01d9e33..7619e5a 100644 --- a/lib/DBIx/Class/InflateColumn.pm +++ b/lib/DBIx/Class/InflateColumn.pm @@ -75,7 +75,7 @@ sub new { $attrs->{$key} = $class->_deflated_column($key, $attrs->{$key}); } } - return $class->NEXT::ACTUAL::new($attrs, @rest); + return $class->next::method($attrs, @rest); } 1; diff --git a/lib/DBIx/Class/ObjectCache.pm b/lib/DBIx/Class/ObjectCache.pm index 39fb218..5035153 100644 --- a/lib/DBIx/Class/ObjectCache.pm +++ b/lib/DBIx/Class/ObjectCache.pm @@ -33,14 +33,14 @@ implements the required C, C, and C methods. sub insert { my $self = shift; - $self->NEXT::ACTUAL::insert(@_); + $self->next::method(@_); $self->_insert_into_cache if $self->cache; return $self; } sub find { my ($self,@vals) = @_; - return $self->NEXT::ACTUAL::find(@vals) unless $self->cache; + return $self->next::method(@vals) unless $self->cache; # this is a terrible hack here. I know it can be improved. # but, it's a start anyway. probably find in PK.pm needs to @@ -62,14 +62,14 @@ sub find { return $object; } - $object = $self->NEXT::ACTUAL::find(@vals); + $object = $self->next::method(@vals); $object->_insert_into_cache if $object; return $object; } sub update { my $self = shift; - my $new = $self->NEXT::ACTUAL::update(@_); + my $new = $self->next::method(@_); $self->_insert_into_cache if $self->cache; return; } @@ -77,12 +77,12 @@ sub update { sub delete { my $self = shift; $self->cache->remove($self->ID) if $self->cache; - return $self->NEXT::ACTUAL::delete(@_); + return $self->next::method(@_); } sub _row_to_object { my $self = shift; - my $new = $self->NEXT::ACTUAL::_row_to_object(@_); + my $new = $self->next::method(@_); $new->_insert_into_cache if $self->cache; return $new; } diff --git a/lib/DBIx/Class/PK/Auto.pm b/lib/DBIx/Class/PK/Auto.pm index c2027cc..fd2531b 100644 --- a/lib/DBIx/Class/PK/Auto.pm +++ b/lib/DBIx/Class/PK/Auto.pm @@ -31,7 +31,7 @@ primary keys. sub insert { my ($self, @rest) = @_; - my $ret = $self->NEXT::ACTUAL::insert(@rest); + my $ret = $self->next::method(@rest); # if all primaries are already populated, skip auto-inc my $populated = 0; diff --git a/lib/DBIx/Class/Relationship/Accessor.pm b/lib/DBIx/Class/Relationship/Accessor.pm index 069da80..f641351 100644 --- a/lib/DBIx/Class/Relationship/Accessor.pm +++ b/lib/DBIx/Class/Relationship/Accessor.pm @@ -5,7 +5,7 @@ use warnings; sub add_relationship { my ($class, $rel, @rest) = @_; - my $ret = $class->NEXT::ACTUAL::add_relationship($rel => @rest); + my $ret = $class->next::method($rel => @rest); my $rel_obj = $class->_relationships->{$rel}; if (my $acc_type = $rel_obj->{attrs}{accessor}) { $class->add_relationship_accessor($rel => $acc_type); diff --git a/lib/DBIx/Class/Relationship/Base.pm b/lib/DBIx/Class/Relationship/Base.pm index 5b654af..b1d11a7 100644 --- a/lib/DBIx/Class/Relationship/Base.pm +++ b/lib/DBIx/Class/Relationship/Base.pm @@ -123,7 +123,7 @@ sub _cond_key { join(', ', keys %{$attrs->{_aliases} || {}}) ); } } - return $self->NEXT::ACTUAL::_cond_key($attrs, $key); + return $self->next::method($attrs, $key); } sub _cond_value { @@ -151,7 +151,7 @@ sub _cond_value { } } - return $self->NEXT::ACTUAL::_cond_value($attrs, $key, $value) + return $self->next::method($attrs, $key, $value) } =item search_related diff --git a/lib/DBIx/Class/Relationship/CascadeActions.pm b/lib/DBIx/Class/Relationship/CascadeActions.pm index b26345b..0da3993 100644 --- a/lib/DBIx/Class/Relationship/CascadeActions.pm +++ b/lib/DBIx/Class/Relationship/CascadeActions.pm @@ -2,12 +2,12 @@ package DBIx::Class::Relationship::CascadeActions; sub delete { my ($self, @rest) = @_; - return $self->NEXT::ACTUAL::delete(@rest) unless ref $self; + return $self->next::method(@rest) unless ref $self; # I'm just ignoring this for class deletes because hell, the db should # be handling this anyway. Assuming we have joins we probably actually # *could* do them, but I'd rather not. - my $ret = $self->NEXT::ACTUAL::delete(@rest); + my $ret = $self->next::method(@rest); my %rels = %{ $self->_relationships }; my @cascade = grep { $rels{$_}{attrs}{cascade_delete} } keys %rels; @@ -19,10 +19,10 @@ sub delete { sub update { my ($self, @rest) = @_; - return $self->NEXT::ACTUAL::update(@rest) unless ref $self; + return $self->next::method(@rest) unless ref $self; # Because update cascades on a class *really* don't make sense! - my $ret = $self->NEXT::ACTUAL::update(@rest); + my $ret = $self->next::method(@rest); my %rels = %{ $self->_relationships }; my @cascade = grep { $rels{$_}{attrs}{cascade_update} } keys %rels; diff --git a/lib/DBIx/Class/Relationship/ProxyMethods.pm b/lib/DBIx/Class/Relationship/ProxyMethods.pm index 11a4e28..51e65e3 100644 --- a/lib/DBIx/Class/Relationship/ProxyMethods.pm +++ b/lib/DBIx/Class/Relationship/ProxyMethods.pm @@ -7,7 +7,7 @@ use base qw/Class::Data::Inheritable/; sub add_relationship { my ($class, $rel, @rest) = @_; - my $ret = $class->NEXT::ACTUAL::add_relationship($rel => @rest); + my $ret = $class->next::method($rel => @rest); if (my $proxy_list = $class->_relationships->{$rel}->{attrs}{proxy}) { $class->proxy_to_related($rel, (ref $proxy_list ? @$proxy_list : $proxy_list)); diff --git a/lib/DBIx/Class/UUIDColumns.pm b/lib/DBIx/Class/UUIDColumns.pm index 15d6826..97444a1 100644 --- a/lib/DBIx/Class/UUIDColumns.pm +++ b/lib/DBIx/Class/UUIDColumns.pm @@ -45,7 +45,7 @@ sub insert { $self->store_column( $column, $self->get_uuid ) unless defined $self->get_column( $column ); } - $self->NEXT::ACTUAL::insert; + $self->next::method; } sub get_uuid {