X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FTable.pm;h=42631ded9ac97b3ceac7719394d56b4698d6ae4d;hb=bb37a8cfe91fcbaa4f1294c2877bd33aa77a49e1;hp=ba79341255019caf3f5cdc711815b1d1ccf47da6;hpb=daec44b85cffd777869c9652273670b27625e167;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Table.pm b/lib/DBIx/Class/Table.pm index ba79341..42631de 100644 --- a/lib/DBIx/Class/Table.pm +++ b/lib/DBIx/Class/Table.pm @@ -4,6 +4,7 @@ use strict; use warnings; use DBIx::Class::ResultSet; +use Data::Page; use base qw/Class::Data::Inheritable/; @@ -112,9 +113,9 @@ sub search { $attrs = { %{ pop(@_) } }; } $attrs->{where} = (@_ == 1 || ref $_[0] eq "HASH" ? shift: {@_}); - + my $rs = $class->resultset($attrs); - + return (wantarray ? $rs->all : $rs); } @@ -169,7 +170,7 @@ creates one and returns that instead sub find_or_create { my $class = shift; my $hash = ref $_[0] eq "HASH" ? shift: {@_}; - my ($exists) = $class->search($hash); + my $exists = $class->find($hash); return defined($exists) ? $exists : $class->create($hash); }