line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Store::CA::Bag; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
963
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
4
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
19
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
3
|
use Moo; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
7
|
1
|
|
|
1
|
|
202
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
131
|
use Catmandu::CA::API; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
334
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
with 'Catmandu::Bag'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub generator { |
14
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
15
|
0
|
|
|
|
|
|
Catmandu::NotImplemented->throw( |
16
|
|
|
|
|
|
|
message => 'Iterating over items not supported.' |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub get { |
21
|
|
|
|
|
|
|
my ($self, $id) = @_; |
22
|
|
|
|
|
|
|
my $field_list = $self->store->_field_list; |
23
|
|
|
|
|
|
|
my $api = Catmandu::CA::API->new( |
24
|
|
|
|
|
|
|
url => $self->store->url, |
25
|
|
|
|
|
|
|
username => $self->store->username, |
26
|
|
|
|
|
|
|
password => $self->store->password, |
27
|
|
|
|
|
|
|
lang => $self->store->lang |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
return $api->id($id, $field_list); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub add { |
33
|
|
|
|
|
|
|
my ($self, $data) = @_; |
34
|
|
|
|
|
|
|
my $api = Catmandu::CA::API->new( |
35
|
|
|
|
|
|
|
url => $self->store->url, |
36
|
|
|
|
|
|
|
username => $self->store->username, |
37
|
|
|
|
|
|
|
password => $self->store->password, |
38
|
|
|
|
|
|
|
lang => $self->store->lang |
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
return $api->add($data); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub update { |
44
|
0
|
|
|
0
|
0
|
|
my ($self, $id, $data) = @_; |
45
|
0
|
|
|
|
|
|
my $api = Catmandu::CA::API->new( |
46
|
|
|
|
|
|
|
url => $self->store->url, |
47
|
|
|
|
|
|
|
username => $self->store->username, |
48
|
|
|
|
|
|
|
password => $self->store->password, |
49
|
|
|
|
|
|
|
lang => $self->store->lang |
50
|
|
|
|
|
|
|
); |
51
|
0
|
|
|
|
|
|
return $api->update($id, $data); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub delete { |
55
|
|
|
|
|
|
|
my ($self, $id) = @_; |
56
|
|
|
|
|
|
|
my $api = Catmandu::CA::API->new( |
57
|
|
|
|
|
|
|
url => $self->store->url, |
58
|
|
|
|
|
|
|
username => $self->store->username, |
59
|
|
|
|
|
|
|
password => $self->store->password, |
60
|
|
|
|
|
|
|
lang => $self->store->lang |
61
|
|
|
|
|
|
|
); |
62
|
|
|
|
|
|
|
return $api->delete($id); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub delete_all { |
66
|
|
|
|
|
|
|
my $self = shift; |
67
|
|
|
|
|
|
|
Catmandu::NotImplemented->throw( |
68
|
|
|
|
|
|
|
message => 'Deleting items from store not supported.' |
69
|
|
|
|
|
|
|
); |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |
73
|
|
|
|
|
|
|
__END__ |