1 package # hide from PAUSE
2 DBIx::Class::CDBICompat::Retrieve;
5 use warnings FATAL => 'all';
10 die "No args to retrieve" unless @_ > 0;
12 my @cols = $self->primary_columns;
15 if (ref $_[0] eq 'HASH') {
16 $query = { %{$_[0]} };
20 @{$query}{@cols} = @_;
26 $query = $self->_build_query($query);
32 my $query = ref $_[0] eq 'HASH' ? shift : {@_};
34 $query = $self->_build_query($query);
35 $self->next::method($query);
40 # Build a query hash. Defaults to a no-op; ColumnCase overrides.
43 my ($self, $query) = @_;
48 sub retrieve_from_sql {
49 my ($class, $cond, @rest) = @_;
50 $cond =~ s/^\s*WHERE//i;
51 $class->search_literal($cond, @rest);
54 sub retrieve_all { shift->search }
55 sub count_all { shift->count }
56 # Contributed by Numa. No test for this though.