Commit | Line | Data |
c0494fe1 |
1 | package # hide form PAUSE |
2 | DBIx::Class::CDBICompat::AbstractSearch; |
3 | |
4 | use strict; |
5 | use warnings; |
6 | |
5e0eea35 |
7 | use base 'DBIx::Class'; |
8 | |
d03c0706 |
9 | =head1 NAME |
10 | |
b24d86a1 |
11 | DBIx::Class::CDBICompat::AbstractSearch - Emulates Class::DBI::AbstractSearch |
d03c0706 |
12 | |
13 | =head1 SYNOPSIS |
14 | |
48580715 |
15 | See DBIx::Class::CDBICompat for usage directions. |
d03c0706 |
16 | |
17 | =head1 DESCRIPTION |
18 | |
19 | Emulates L<Class::DBI::AbstractSearch>. |
20 | |
21 | =cut |
22 | |
c0494fe1 |
23 | # The keys are mostly the same. |
24 | my %cdbi2dbix = ( |
25 | limit => 'rows', |
26 | ); |
27 | |
28 | sub search_where { |
29 | my $class = shift; |
30 | my $where = (ref $_[0]) ? $_[0] : { @_ }; |
31 | my $attr = (ref $_[0]) ? $_[1] : {}; |
32 | |
33 | # Translate the keys |
34 | $attr->{$cdbi2dbix{$_}} = delete $attr->{$_} for keys %cdbi2dbix; |
35 | |
36 | return $class->resultset_instance->search($where, $attr); |
37 | } |
38 | |
a2bd3796 |
39 | =head1 FURTHER QUESTIONS? |
40 | |
41 | Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>. |
42 | |
43 | =head1 COPYRIGHT AND LICENSE |
44 | |
45 | This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE> |
46 | by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can |
47 | redistribute it and/or modify it under the same terms as the |
48 | L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>. |
49 | |
50 | =cut |
51 | |
c0494fe1 |
52 | 1; |