d55382c7a2cb9f38d137ac0573ebaa17b15cece8
[koha.git] / Koha / Course / Item.pm
1 package Koha::Course::Item;
2
3 # This file is part of Koha.
4 #
5 # Koha is free software; you can redistribute it and/or modify it under the
6 # terms of the GNU General Public License as published by the Free Software
7 # Foundation; either version 3 of the License, or (at your option) any later
8 # version.
9 #
10 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License along
15 # with Koha; if not, write to the Free Software Foundation, Inc.,
16 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18 use Modern::Perl;
19
20
21 use base qw(Koha::Object);
22
23 use Koha::Course::Reserves;
24
25 =head1 NAME
26
27 Koha::Course::Item - Koha Course Item Object class
28
29 =head1 API
30
31 =head2 Methods
32
33 =head3 is_enabled
34
35 =cut
36
37 sub is_enabled {
38     my ( $self ) = @_;
39
40     return $self->enabled eq 'yes';
41 }
42
43 =head3 course_reserves
44
45 =cut
46
47 sub course_reserves {
48     my ($self) = @_;
49
50     my $rs = $self->_result->course_reserves;
51     return Koha::Course::Reserves->_new_from_dbic( $rs );
52 }
53
54 =head3 item
55
56 =cut
57
58 sub item {
59     my ($self) = @_;
60
61     my $rs = $self->_result->itemnumber;
62     return Koha::Item->_new_from_dbic( $rs );
63 }
64
65 =head2 Internal methods
66
67 =cut
68
69 =head3 _type
70
71 =cut
72
73 sub _type {
74     return 'CourseItem';
75 }
76
77 1;