Update to add myself to contributors and to hide Modules from the PAUSE Indexer.
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat / Retrieve.pm
index ef99720..899ed69 100644 (file)
@@ -1,13 +1,23 @@
-package DBIx::Class::CDBICompat::Retrieve;
+package # hide from PAUSE
+    DBIx::Class::CDBICompat::Retrieve;
 
 use strict;
 use warnings FATAL => 'all';
 
-sub retrieve          { shift->find(@_)            }
-sub retrieve_all      { shift->search_literal('1') }
-sub retrieve_from_sql { shift->search_literal(@_)  }
 
-sub count_all          { shift->count_literal('1')  }
+sub retrieve  {
+  die "No args to retrieve" unless @_ > 1;
+  shift->find(@_);
+}
+
+sub retrieve_from_sql {
+  my ($class, $cond, @rest) = @_;
+  $cond =~ s/^\s*WHERE//i;
+  $class->search_literal($cond, @rest);
+}
+
+sub retrieve_all      { shift->search              }
+sub count_all         { shift->count               }
   # Contributed by Numa. No test for this though.
 
 1;