View | Details | Raw Unified | Return to bug 23681
Collapse All | Expand All

(-)a/Koha/RestrictionType.pm (+42 lines)
Line 0 Link Here
1
package Koha::RestrictionType;
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
use base qw(Koha::Object);
21
22
=head1 NAME
23
24
Koha::RestrictionType - Koha RestrictionType Object class
25
26
=head1 API
27
28
=head2 Class Methods
29
30
=cut
31
32
=head2 Internal methods
33
34
=head3 type
35
36
=cut
37
38
sub _type {
39
    return 'DebarmentType';
40
}
41
42
1;
(-)a/Koha/RestrictionTypes.pm (-1 / +75 lines)
Line 0 Link Here
0
- 
1
package Koha::RestrictionTypes;
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
use Carp;
21
22
use C4::Context;
23
24
use Koha::Database;
25
use Koha::RestrictionType;
26
27
use base qw(Koha::Objects);
28
29
=head1 NAME
30
31
Koha::RestrictionTypes - Koha Restriction Types Object set class
32
33
=head1 API
34
35
=head2 Class Methods
36
37
=cut
38
39
=head3 type
40
41
Return all restriction types as a hashref keyed on the code
42
43
=cut
44
45
sub keyed_on_code {
46
    my ( $self ) = @_;
47
48
    my @all = $self->_resultset()->search();
49
    my $out = {};
50
    for my $r( @all ) {
51
        my %col = $r->get_columns;
52
        $out->{$r->code} = \%col;
53
    }
54
    return $out;
55
}
56
57
=head3 type
58
59
=cut
60
61
sub _type {
62
    return 'DebarmentType';
63
}
64
65
=head3 type
66
67
Object class
68
69
=cut
70
71
sub object_class {
72
    return 'Koha::RestrictionType';
73
}
74
75
1;

Return to bug 23681