From: Moritz Bunkus Date: Wed, 20 Dec 2017 14:29:27 +0000 (+0100) Subject: Presenter: can-Aufruf an geproxytes Objekt durchreichen & geproxyte Klasse laden X-Git-Tag: release-3.5.4~551 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=43c3e3bcacd31a3d33208bd5ea447a2e5992b76a;p=kivitendo-erp.git Presenter: can-Aufruf an geproxytes Objekt durchreichen & geproxyte Klasse laden --- 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__