Bug 19230: Preventing warn when deleting course
[koha.git] / Koha / ArticleRequests.pm
1 package Koha::ArticleRequests;
2
3 # Copyright ByWater Solutions 2015
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
26 use Koha::ArticleRequest;
27 use Koha::ArticleRequest::Status;
28
29 use base qw(Koha::Objects);
30
31 =head1 NAME
32
33 Koha::ArticleRequests - Koha ArticleRequests Object class
34
35 =head1 API
36
37 =head2 Class Methods
38
39 =cut
40
41 =head3 pending
42
43 =cut
44
45 sub pending {
46     my ( $self, $branchcode ) = @_;
47     my $params = { status => Koha::ArticleRequest::Status::Pending };
48     $params->{branchcode} = $branchcode if $branchcode;
49     return Koha::ArticleRequests->search( $params );
50 }
51
52 =head3 processing
53
54 =cut
55
56 sub processing {
57     my ( $self, $branchcode ) = @_;
58     my $params = { status => Koha::ArticleRequest::Status::Processing };
59     $params->{branchcode} = $branchcode if $branchcode;
60     return Koha::ArticleRequests->search( $params );
61 }
62
63 =head3 completed
64
65 =cut
66
67 sub completed {
68     my ( $self, $branchcode ) = @_;
69     my $params = { status => Koha::ArticleRequest::Status::Completed };
70     $params->{branchcode} = $branchcode if $branchcode;
71     return Koha::ArticleRequests->search( $params );
72 }
73
74 =head3 canceled
75
76 =cut
77
78 sub canceled {
79     my ( $self, $branchcode ) = @_;
80     my $params = { status => Koha::ArticleRequest::Status::Canceled };
81     $params->{branchcode} = $branchcode if $branchcode;
82     return Koha::ArticleRequests->search( $params );
83 }
84
85 =head3 _type
86
87 =cut
88
89 sub _type {
90     return 'ArticleRequest';
91 }
92
93 sub object_class {
94     return 'Koha::ArticleRequest';
95 }
96
97 =head1 AUTHOR
98
99 Kyle M Hall <kyle@bywatersolutions.com>
100
101 =cut
102
103 1;