File Coverage

blib/lib/Biblio/Zotero/DB/Schema/ResultSet/ItemData.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 16 17 94.1


line stmt bran cond sub pod time code
1             package Biblio::Zotero::DB::Schema::ResultSet::ItemData;
2             $Biblio::Zotero::DB::Schema::ResultSet::ItemData::VERSION = '0.003';
3 13     13   74295 use strict;
  13         39  
  13         525  
4 13     13   78 use warnings;
  13         35  
  13         441  
5 13     13   79 use base 'DBIx::Class::ResultSet';
  13         29  
  13         2778  
6              
7             sub fields_for_itemid {
8 21     21 0 51168 my ($self, $itemid) = @_;
9              
10              
11 21         187 return { map { $_->field_value }
  129         485780  
12             $self->search(
13             { 'itemid' => $itemid },
14             { prefetch => [qw/fieldid valueid/] }
15             )->all
16             };
17             }
18              
19             1;
20              
21             __END__