Bug 27327: Get rid of indirect object notation in Koha::Club::Hold

This patch makes the code follow the PERL29 coding guideline. Period.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Tomas Cohen Arazi 2021-01-04 10:35:37 -03:00 committed by Jonathan Druart
parent 582fc2730a
commit 17a3476d7e
1 changed files with 8 additions and 4 deletions

View File

@ -54,17 +54,21 @@ Class (static) method that returns a new Koha::Club::Hold instance
sub add {
my ( $params ) = @_;
throw Koha::Exceptions::ClubHold unless $params->{club_id} && $params->{biblio_id};
Koha::Exceptions::ClubHold->throw()
unless $params->{club_id} && $params->{biblio_id};
my $club = Koha::Clubs->find($params->{club_id});
my @enrollments = $club->club_enrollments->as_list;
throw Koha::Exceptions::ClubHold::NoPatrons() unless scalar @enrollments;
Koha::Exceptions::ClubHold::NoPatrons->throw()
unless scalar @enrollments;
my $biblio = Koha::Biblios->find($params->{biblio_id});
my $club_params = {
club_id => $params->{club_id},
club_id => $params->{club_id},
biblio_id => $params->{biblio_id},
item_id => $params->{item_id}
item_id => $params->{item_id}
};
my $club_hold = Koha::Club::Hold->new($club_params)->store();