Bug 29002: DBIC Schema Build
[koha.git] / Koha / Illrequestattribute.pm
1 package Koha::Illrequestattribute;
2
3 # Copyright PTFS Europe 2016
4 #
5 # This file is part of Koha.
6 #
7 # Koha is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # Koha is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with Koha; if not, see <http://www.gnu.org/licenses>.
19
20 use Modern::Perl;
21
22 use Koha::Database;
23
24 use base qw(Koha::Object);
25
26 =head1 NAME
27
28 Koha::Illrequestattribute - Koha Illrequestattribute Object class
29
30 =head1 API
31
32 =head2 Class methods
33
34 =head3 store
35
36 Overloaded store method to ensure we have backend filled if not already passed
37
38 =cut
39
40 sub store {
41     my ($self) = @_;
42
43     if ( !$self->backend ) {
44         $self->backend( $self->request->backend );
45     }
46
47     return $self->SUPER::store;
48 }
49
50 =head3 request
51
52 Returns a Koha::Illrequest object representing the core request.
53
54 =cut
55
56 sub request {
57     my ($self) = @_;
58     return Koha::Illrequest->_new_from_dbic( $self->_result->illrequest );
59 }
60
61 =head2 Internal methods
62
63 =head3 _type
64
65 =cut
66
67 sub _type {
68     return 'Illrequestattribute';
69 }
70
71 =head3 to_api_mapping
72
73 This method returns the mapping for representing a Koha::Illrequestattribute object
74 on the API.
75
76 =cut
77
78 sub to_api_mapping {
79     return {
80         illrequest_id => 'ill_request_id',
81         readonly      => 'read_only',
82     };
83 }
84
85 =head1 AUTHOR
86
87 Alex Sassmannshausen <alex.sassmannshausen@ptfs-europe.com>
88
89 =cut
90
91 1;