Bug 18807: t/db_dependent/www/batch.t fails
[koha.git] / Koha / ArticleRequests.pm
blobbc47789be640acecaee0149bd85fc6f9a9a3a502
1 package Koha::ArticleRequests;
3 # Copyright ByWater Solutions 2015
5 # This file is part of Koha.
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.
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.
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.
20 use Modern::Perl;
22 use Carp;
24 use Koha::Database;
26 use Koha::ArticleRequest;
27 use Koha::ArticleRequest::Status;
29 use base qw(Koha::Objects);
31 =head1 NAME
33 Koha::ArticleRequests - Koha ArticleRequests Object class
35 =head1 API
37 =head2 Class Methods
39 =cut
41 =head3 pending
43 =cut
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 );
52 =head3 processing
54 =cut
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 );
63 =head3 completed
65 =cut
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 );
74 =head3 canceled
76 =cut
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 );
85 =head3 _type
87 =cut
89 sub _type {
90 return 'ArticleRequest';
93 sub object_class {
94 return 'Koha::ArticleRequest';
97 =head1 AUTHOR
99 Kyle M Hall <kyle@bywatersolutions.com>
101 =cut