Bug 12461 - Add patron clubs feature
[koha.git] / Koha / Club / Enrollment.pm
1 package Koha::Club::Enrollment;
2
3 # Copyright ByWater Solutions 2014
4 #
5 # This file is part of Koha.
6 #
7 # Koha is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 3 of the License, or (at your option) any later
10 # version.
11 #
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License along
17 # with Koha; if not, write to the Free Software Foundation, Inc.,
18 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20 use Modern::Perl;
21
22 use Carp;
23
24 use Koha::Database;
25 use Koha::Clubs;
26
27 use base qw(Koha::Object);
28
29 =head1 NAME
30
31 Koha::Club::Enrollment
32
33 Represents a "pattern" on which many clubs can be created.
34 In this way we can directly compare different clubs of the same 'template'
35 for statistical purposes.
36
37 =head1 API
38
39 =head2 Class Methods
40
41 =cut
42
43 =head3 cancel
44
45 =cut
46
47 sub cancel {
48     my ( $self ) = @_;
49
50     $self->_result()->update( { date_canceled => \'NOW()' } );
51
52     return $self;
53 }
54
55 =head3 club
56
57 =cut
58
59 sub club {
60     my ( $self ) = @_;
61     return Koha::Clubs->find( $self->club_id() );
62 }
63
64 =head3 type
65
66 =cut
67
68 sub _type {
69     return 'ClubEnrollment';
70 }
71
72 =head1 AUTHOR
73
74 Kyle M Hall <kyle@bywatersolutions.com>
75
76 =cut
77
78 1;