File Coverage

blib/lib/Biblio/Zotero/DB/Library/Unfiled.pm
Criterion Covered Total %
statement 13 13 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 18 18 100.0


line stmt bran cond sub pod time code
1             package Biblio::Zotero::DB::Library::Unfiled;
2             $Biblio::Zotero::DB::Library::Unfiled::VERSION = '0.003';
3 12     12   70 use strict;
  12         32  
  12         388  
4 12     12   68 use warnings;
  12         39  
  12         292  
5 12     12   62 use Moo;
  12         35  
  12         77  
6              
7             has _db => ( is => 'ro', weak_ref => 1 );
8              
9             has name => ( is => 'ro', default => sub { 'Unfiled Items' } );
10              
11             sub items {
12 1     1 1 7 my $self = shift;
13 1         27 my $schema = $self->_db->schema;
14 1         15 my $items = $schema->resultset('CollectionItem')
15             ->get_column('itemid')->as_query;
16 1         1656 $schema->resultset('StoredItem')
17             ->with_item_attachment_resultset('StoredItemAttachment')
18             ->_toplevel_items
19             ->search( { 'me.itemid' => { 'not in' => $items } });
20             }
21              
22             1;
23              
24             __END__