1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
package Catmandu::Store::VIAF::Bag;
use strict;
use warnings;
use Catmandu::Sane;
use Moo;
use Catmandu::VIAF::API;
with 'Catmandu::Bag';
sub generator {
my $self = shift;
Catmandu::NotImplemented->throw(
message => 'Iterating over items in this store not supported.'
);
}
sub get {
my ($self, $id) = @_;
my $a = Catmandu::VIAF::API->new(
term => $id,
lang => $self->store->lang,
fallback_lang => $self->store->fallback_lang
);
return $a->id();
}
sub add {
my ($self, $data) = @_;
Catmandu::NotImplemented->throw(
message => 'Adding item to store not supported.'
);
}
sub update {
my ($self, $id, $data) = @_;
Catmandu::NotImplemented->throw(
message => 'Updating item in store not supported.'
);
}
sub delete {
my ($self, $id) = @_;
Catmandu::NotImplemented->throw(
message => 'Deleting item from store not supported.'
);
}
sub delete_all {
my $self = shift;
Catmandu::NotImplemented->throw(
message => 'Deleting items from store not supported.'
);
}
1;
__END__
|