From 90e40342446cda3cd2c962cfbfd92ae5aa56c37c Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Mon, 18 Dec 2023 16:11:01 -0100 Subject: [PATCH] Bug 35604: New Backends.pm class. installed_backends method Signed-off-by: David Nind --- Koha/ILL/Backends.pm | 74 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 Koha/ILL/Backends.pm diff --git a/Koha/ILL/Backends.pm b/Koha/ILL/Backends.pm new file mode 100644 index 0000000000..eec8d27863 --- /dev/null +++ b/Koha/ILL/Backends.pm @@ -0,0 +1,74 @@ +package Koha::ILL::Backends; + +# Copyright PTFS Europe 2023 +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use base qw(Koha::Objects); + +=head1 NAME + +Koha::ILL::Backends - Koha Illbackends Object class + +=head2 Class methods + +=head3 new + +New ILL Backend + +=cut + +sub new { + my $class = shift; + my $self = {}; + return bless $self, $class; +} + +=head3 installed_backends + +Return a list of installed backends. + +=cut + +sub installed_backends { + my $backends = Koha::ILL::Request::Config->new->available_backends; + my @installed = grep { !/Standard/ } @{$backends}; + return \@installed; +} + +=head2 Internal methods + +=head3 _type + + my $type = Koha::ILL::Backend->_type; + +Return this object's type + +=cut + +sub _type { + return 'Illbackend'; +} + +=head1 AUTHOR + +Pedro Amorim + +=cut + +1; -- 2.39.2