From 43c3e3bcacd31a3d33208bd5ea447a2e5992b76a Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 20 Dec 2017 15:29:27 +0100 Subject: [PATCH] Presenter: can-Aufruf an geproxytes Objekt durchreichen & geproxyte Klasse laden --- SL/DB/Helper/Presenter.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SL/DB/Helper/Presenter.pm b/SL/DB/Helper/Presenter.pm index 9c9f8a25d..0a33902af 100644 --- a/SL/DB/Helper/Presenter.pm +++ b/SL/DB/Helper/Presenter.pm @@ -17,11 +17,19 @@ sub AUTOLOAD { return if $method eq 'DESTROY'; + eval "require $self->[0]"; + if (my $sub = $self->[0]->can($method)) { return $sub->($self->[1], @args); } } +sub can { + my ($self, $method) = @_; + eval "require $self->[0]"; + $self->[0]->can($method); +} + 1; __END__ -- 2.20.1