Commit | Line | Data |
c0494fe1 |
1 | package # hide form PAUSE |
2 | DBIx::Class::CDBICompat::AbstractSearch; |
3 | |
4 | use strict; |
5 | use warnings; |
6 | |
7 | # The keys are mostly the same. |
8 | my %cdbi2dbix = ( |
9 | limit => 'rows', |
10 | ); |
11 | |
12 | sub search_where { |
13 | my $class = shift; |
14 | my $where = (ref $_[0]) ? $_[0] : { @_ }; |
15 | my $attr = (ref $_[0]) ? $_[1] : {}; |
16 | |
17 | # Translate the keys |
18 | $attr->{$cdbi2dbix{$_}} = delete $attr->{$_} for keys %cdbi2dbix; |
19 | |
20 | return $class->resultset_instance->search($where, $attr); |
21 | } |
22 | |
23 | 1; |