1 package Koha::ItemType;
3 # This represents a single itemtype
5 # Copyright 2014 Catalyst IT
7 # This file is part of Koha.
9 # Koha is free software; you can redistribute it and/or modify it under the
10 # terms of the GNU General Public License as published by the Free Software
11 # Foundation; either version 3 of the License, or (at your option) any later
14 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License along
19 # with Koha; if not, write to the Free Software Foundation, Inc.,
20 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 use Koha::Localizations;
31 use base qw(Koha::Object);
35 Koha::ItemType - Koha Item type Object class
48 my ( $self, $interface ) = @_;
49 return C4::Koha::getitemtypeimagelocation( $interface, $self->SUPER::imageurl );
52 =head3 translated_description
56 sub translated_description {
57 my ( $self, $lang ) = @_;
58 $lang ||= C4::Languages::getlanguage;
59 my $translated_description = Koha::Localizations->search({
60 code => $self->itemtype,
61 entity => 'itemtypes',
64 return $translated_description
65 ? $translated_description->translation
69 =head3 translated_descriptions
73 sub translated_descriptions {
75 my @translated_descriptions = Koha::Localizations->search(
76 { entity => 'itemtypes',
77 code => $self->itemtype,
83 translation => $_->translation,
85 } @translated_descriptions ];