~ubuntu-branches/ubuntu/precise/libjifty-dbi-perl/precise

« back to all changes in this revision

Viewing changes to lib/Jifty/DBI/Collection.pm

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Yu
  • Date: 2011-03-01 20:29:12 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20110301202912-pvf5r3de3vqp40w0
Tags: 0.67-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
972
972
            .' '. ($args{'sort'} =~ /^des/i ? 'DESC' : 'ASC');
973
973
    }
974
974
 
975
 
    my $dbh = $self->_handle->dbh;
976
 
    my $list = $dbh->selectcol_arrayref( $query_string, { MaxRows => $args{'max'} } );
977
 
    return $list? @$list : ();
 
975
    my $sth  = $self->_handle->simple_query( $query_string ) or return;
 
976
    my $value;
 
977
    $sth->bind_col(1, \$value) or return;
 
978
    my @col;
 
979
    if ($args{max}) {
 
980
        push @col, $value while 0 < $args{max}-- && $sth->fetch;
 
981
    } else {
 
982
        push @col, $value while $sth->fetch;
 
983
    }
 
984
    return @col;
978
985
}
979
986
 
980
987
=head2 items_array_ref