Remove Class::Data::Inheritable and use CAG 'inherited' style accessors
[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
5e0eea35 7use base 'DBIx::Class';
8
d03c0706 9=head1 NAME
10
b24d86a1 11DBIx::Class::CDBICompat::AbstractSearch - Emulates Class::DBI::AbstractSearch
d03c0706 12
13=head1 SYNOPSIS
14
48580715 15See DBIx::Class::CDBICompat for usage directions.
d03c0706 16
17=head1 DESCRIPTION
18
19Emulates L<Class::DBI::AbstractSearch>.
20
21=cut
22
c0494fe1 23# The keys are mostly the same.
24my %cdbi2dbix = (
25 limit => 'rows',
26);
27
28sub 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
41Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.
42
43=head1 COPYRIGHT AND LICENSE
44
45This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE>
46by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can
47redistribute it and/or modify it under the same terms as the
48L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>.
49
50=cut
51
c0494fe1 521;