| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Biblio::Zotero::DB::Schema::Result::TrashItemAttachment; |
|
2
|
|
|
|
|
|
|
$Biblio::Zotero::DB::Schema::Result::TrashItemAttachment::VERSION = '0.003'; |
|
3
|
|
|
|
|
|
|
# TODO: document |
|
4
|
|
|
|
|
|
|
|
|
5
|
13
|
|
|
13
|
|
10240
|
use strict; |
|
|
13
|
|
|
|
|
31
|
|
|
|
13
|
|
|
|
|
493
|
|
|
6
|
13
|
|
|
13
|
|
69
|
use warnings; |
|
|
13
|
|
|
|
|
31
|
|
|
|
13
|
|
|
|
|
369
|
|
|
7
|
13
|
|
|
13
|
|
71
|
use base qw/Biblio::Zotero::DB::Schema::Result::ItemAttachment/; |
|
|
13
|
|
|
|
|
27
|
|
|
|
13
|
|
|
|
|
3647
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
__PACKAGE__->table_class('DBIx::Class::ResultSource::View'); |
|
10
|
|
|
|
|
|
|
__PACKAGE__->table('trashItemAttachments'); |
|
11
|
|
|
|
|
|
|
__PACKAGE__->result_source_instance->is_virtual(1); |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# NOTE: SQL |
|
14
|
|
|
|
|
|
|
__PACKAGE__->result_source_instance->view_definition( |
|
15
|
|
|
|
|
|
|
q[ |
|
16
|
|
|
|
|
|
|
SELECT * FROM itemAttachments me |
|
17
|
|
|
|
|
|
|
WHERE ( |
|
18
|
|
|
|
|
|
|
itemid IN ( SELECT me.itemid FROM deletedItems me ) |
|
19
|
|
|
|
|
|
|
OR |
|
20
|
|
|
|
|
|
|
sourceitemid IN ( SELECT me.itemid FROM deletedItems me ) |
|
21
|
|
|
|
|
|
|
) |
|
22
|
|
|
|
|
|
|
] |
|
23
|
|
|
|
|
|
|
); |
|
24
|
|
|
|
|
|
|
# the above view_definition is the same as: |
|
25
|
|
|
|
|
|
|
# ---------------------------------------- |
|
26
|
|
|
|
|
|
|
# my $deleted = $schema->resultset('DeletedItem') |
|
27
|
|
|
|
|
|
|
# ->get_column('itemid') |
|
28
|
|
|
|
|
|
|
# ->as_query; |
|
29
|
|
|
|
|
|
|
# $schema |
|
30
|
|
|
|
|
|
|
# ->resultset('ItemAttachment') |
|
31
|
|
|
|
|
|
|
# ->search( |
|
32
|
|
|
|
|
|
|
# { -or => [ { itemid => { -in => $deleted } }, |
|
33
|
|
|
|
|
|
|
# { sourceitemid => { -in => $deleted } } ] |
|
34
|
|
|
|
|
|
|
# } |
|
35
|
|
|
|
|
|
|
# )->as_query |
|
36
|
|
|
|
|
|
|
# #### |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |