X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FObjectCache.pm;h=3dd8ec0bcae91bf6d2ce8fc59a67478c90a8fa62;hb=1f6927673007a20a42d89f55058bfeb38f2bb704;hp=7827a57dc701f185d832fe9cb43bb7fe2ac78b16;hpb=81c92ae6d6d447ea08595235030032d16da902e7;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/ObjectCache.pm b/lib/DBIx/Class/ObjectCache.pm index 7827a57..3dd8ec0 100644 --- a/lib/DBIx/Class/ObjectCache.pm +++ b/lib/DBIx/Class/ObjectCache.pm @@ -3,7 +3,7 @@ package DBIx::Class::ObjectCache; use strict; use warnings; -use base qw/Class::Data::Inheritable/; +use base qw/DBIx::Class/; __PACKAGE__->mk_classdata('cache'); @@ -14,7 +14,7 @@ __PACKAGE__->mk_classdata('cache'); =head1 SYNOPSIS # in your class definition - use Cache::FastMmmap; + use Cache::FastMmap; __PACKAGE__->cache(Cache::FastMmap->new); =head1 DESCRIPTION @@ -33,20 +33,20 @@ 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 # call a hook, or some such thing. -Dave/ningu my ($object,$key); - my @pk = keys %{$self->_primaries}; + my @pk = $self->primary_columns; if (ref $vals[0] eq 'HASH') { my $cond = $vals[0]->{'-and'}; $key = $self->_create_ID(%{$cond->[0]}) if ref $cond eq 'ARRAY'; @@ -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; } @@ -99,7 +99,7 @@ sub _insert_into_cache { =head1 AUTHORS -David Kamholz +David Kamholz =head1 LICENSE