spelling fixes in the documaentation, sholud be gud now ;)
[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
d03c0706 7=head1 NAME
8
b24d86a1 9DBIx::Class::CDBICompat::AbstractSearch - Emulates Class::DBI::AbstractSearch
d03c0706 10
11=head1 SYNOPSIS
12
48580715 13See DBIx::Class::CDBICompat for usage directions.
d03c0706 14
15=head1 DESCRIPTION
16
17Emulates L<Class::DBI::AbstractSearch>.
18
19=cut
20
c0494fe1 21# The keys are mostly the same.
22my %cdbi2dbix = (
23 limit => 'rows',
24);
25
26sub search_where {
27 my $class = shift;
28 my $where = (ref $_[0]) ? $_[0] : { @_ };
29 my $attr = (ref $_[0]) ? $_[1] : {};
30
31 # Translate the keys
32 $attr->{$cdbi2dbix{$_}} = delete $attr->{$_} for keys %cdbi2dbix;
33
34 return $class->resultset_instance->search($where, $attr);
35}
36
371;