X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI.pm;h=453d51c8b42c3bc9f93bcec9707f75011d4020f2;hb=1a14aa3f5016c456db28c148abab256ea72776df;hp=13b7cc00ec107a2ca9964ef5be65631cac10c323;hpb=15fe6346d3458b5127c743409c5407e0dbc3931b;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 13b7cc0..453d51c 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -123,6 +123,16 @@ sub select { return $self->cursor->new($sth, \@bind, $attrs); } +sub select_single { + my ($self, $ident, $select, $condition, $attrs) = @_; + my $order = $attrs->{order_by}; + if (ref $condition eq 'SCALAR') { + $order = $1 if $$condition =~ s/ORDER BY (.*)$//i; + } + my ($rv, $sth, @bind) = $self->_execute('select', $attrs->{bind}, $ident, $select, $condition, $order); + return $sth->fetchrow_array; +} + sub sth { shift->dbh->prepare(@_); }