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 / +67 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
=cut
42
43
sub keyed_on_code {
44
    my ( $self ) = @_;
45
46
    my @all = $self->_resultset()->search();
47
    my $out = {};
48
    for my $r( @all ) {
49
        my %col = $r->get_columns;
50
        $out->{$r->code} = \%col;
51
    }
52
    return $out;
53
}
54
55
=head3 type
56
57
=cut
58
59
sub _type {
60
    return 'DebarmentType';
61
}
62
63
sub object_class {
64
    return 'Koha::RestrictionType';
65
}
66
67
1;

Return to bug 23681