IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 29, 2005, 12:11:27 PM (21 years ago)
Author:
jhoblitt
Message:

return an array of hasrefs from find_new()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-MetaDB/lib/PS/IPP/MetaDB.pm

    r5185 r5189  
    11# Copyright (C) 2005  Joshua Hoblitt
    22#
    3 # $Id: MetaDB.pm,v 1.4 2005-09-29 21:20:25 jhoblitt Exp $
     3# $Id: MetaDB.pm,v 1.5 2005-09-29 22:11:27 jhoblitt Exp $
    44
    55package PS::IPP::MetaDB;
     
    7777    my %p = @_;
    7878
     79    my @rows;
    7980    if (exists $p{exp_id}) {
    80         PS::IPP::MetaDB::Image::New->search(
     81        @rows = PS::IPP::MetaDB::Image::New->search(
    8182            $p{exp_id},
    8283            { order_by => 'class_id' },
    8384        );
    8485    } else {
    85         PS::IPP::MetaDB::Image::New->retrieve_all;
     86        @rows = PS::IPP::MetaDB::Image::New->retrieve_all;
    8687    }
     88
     89    my @fields = qw( exp_id class_id camera class url );
     90    my @result;
     91    foreach my $obj (@rows) {
     92        my %hash;
     93        @hash{@fields} = $obj->get(@fields);
     94        push(@result, \%hash);
     95    }
     96
     97    return @result;
    8798}
    8899
Note: See TracChangeset for help on using the changeset viewer.