use strict;
use warnings;
-use base qw/Class::Data::Inheritable/;
+use base qw/DBIx::Class/;
__PACKAGE__->mk_classdata('cache');
=head1 SYNOPSIS
# in your class definition
- use Cache::FastMmmap;
+ use Cache::FastMmap;
__PACKAGE__->cache(Cache::FastMmap->new);
=head1 DESCRIPTION
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';
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;
}
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;
}
=head1 AUTHORS
-David Kamholz <davekam@pobox.com>
+David Kamholz <dkamholz@cpan.org>
=head1 LICENSE