1 package Koha::Preservation::Train::Item::Attribute;
3 # This file is part of Koha.
5 # Koha is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # Koha is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with Koha; if not, see <http://www.gnu.org/licenses>.
20 use JSON qw( to_json );
23 use Koha::AuthorisedValues;
25 use base qw(Koha::Object);
27 use Koha::Preservation::Processing::Attributes;
31 Koha::Preservation::Train::Item::Attribute - Koha Train::Item::Attribute Object class
39 =head3 processing_attribute
41 my $processing_attribute = $attribute->processing_attribute;
43 Return the Koha::Preservation::Processing::Attribute object
47 sub processing_attribute {
49 my $processing_attribute_rs = $self->_result->processing_attribute;
50 return Koha::Preservation::Processing::Attribute->_new_from_dbic($processing_attribute_rs)
55 Returns a map of column name to string representations including the string.
61 my $str = $self->value;
62 if ( $self->processing_attribute->type eq 'authorised_value' ) {
63 my $av = Koha::AuthorisedValues->search(
65 category => $self->processing_attribute->option_source,
66 authorised_value => $self->value,
70 $str = $av->next->lib || $self->value;
75 value => { str => $str, type => 'authorised_value' },
79 =head2 Internal methods
86 return 'PreservationProcessingAttributesItem';