Bug 19605: Rename method and use the instantiated plugin in the call
authorTomas Cohen Arazi <tomascohen@theke.io>
Sat, 9 Mar 2024 12:47:45 +0000 (09:47 -0300)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Fri, 19 Apr 2024 17:54:41 +0000 (19:54 +0200)
commite06cd47e251637393d94a1f5bade48950396c87d
tree08c84850130f83e86d4a5abd5e221f0f093fab59
parenta78753367dca1d6814c6dfc100aa286769c14ffc
Bug 19605: Rename method and use the instantiated plugin in the call

This patch makes the backend instantiation happen through a plugin
object method instead of a static one. This way, the (already)
instantiated plugin can be reused (if needed) in the plugin workflow
like this:

sub new_il_backend {
    my ($self, $params) = @_;
    return Custom::Backend->new(
        {
            config => $params->{config},
            logger => $params->{logger},
            plugin => $self,
        }
    );
}

The passed plugin object would then be used to retrieve whatever
plugin-defined configurations, template paths or even helper methods. On
INN-Reach, it gives the backend access to API user agents, task queue
injection, etc.

This patch also renames the method so it is more straight-forward this is
related to ILL.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Koha/Illrequest.pm