Added tests for the core APIs, refactored some
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat / Convenience.pm
1 package DBIx::Class::CDBICompat::Convenience;
2
3 use strict;
4 use warnings;
5
6 sub find_or_create {
7   my $class    = shift;
8   my $hash     = ref $_[0] eq "HASH" ? shift: {@_};
9   my ($exists) = $class->search($hash);
10   return defined($exists) ? $exists : $class->create($hash);
11 }
12
13 sub retrieve_all {
14   my ($class) = @_;
15   return $class->retrieve_from_sql( '1' );
16 }
17
18 1;