and my tradditional collection of missing add commands
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat / AbstractSearch.pm
CommitLineData
c0494fe1 1package # hide form PAUSE
2 DBIx::Class::CDBICompat::AbstractSearch;
3
4use strict;
5use warnings;
6
7# The keys are mostly the same.
8my %cdbi2dbix = (
9 limit => 'rows',
10);
11
12sub 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
231;