DB/Schema/Result/StoredItem.pm

filter: Statementstmt 100% 15 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 18 / 18 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« DB/Schema/Result/StorageDeleteLog.pm ↑ Summary DB/Schema/Result/StoredItemAttachment.pm »
1 package Biblio::Zotero::DB::Schema::Result::StoredItem;
2 13 $Biblio::Zotero::DB::Schema::Result::StoredItem::VERSION = '0.004';
3 # TODO: document
4  
5 13 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 13 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 13 ▶use base qw/Biblio::Zotero::DB::Schema::Result::Item/;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 13 __PACKAGE__->table_class('DBIx::Class::ResultSource::View');
10 13 __PACKAGE__->table('storedItems');
11 13 __PACKAGE__->result_source_instance->is_virtual(1);
12  
13 # NOTE: SQL
14 13 __PACKAGE__->result_source_instance->view_definition(
15 q[
16 SELECT * FROM items me
17 WHERE ( itemid NOT IN ( SELECT me.itemid FROM deletedItems me ) )
18 ]
19 );
20 # the above view_definition is the same as:
21 # ----------------------------------------
22 # my $deleted = $schema->resultset('DeletedItem')
23 # ->get_column('itemid')
24 # ->as_query
25 # $schema
26 # ->resultset('Item')
27 # ->search( { itemid => { 'not in' => $deleted } })
28 # ->as_query
29  
30 13 1;
31  
32 __END__
« DB/Schema/Result/StorageDeleteLog.pm ↑ Summary DB/Schema/Result/StoredItemAttachment.pm »