From af56ae02cd83ad4fff35a3ef695a9fcf4c074caf Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 3 May 2011 17:45:53 +0200 Subject: [PATCH] =?utf8?q?Framework=20f=C3=BCr=20after/before-Hooks=20bei?= =?utf8?q?=20load/save/delete?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Conflicts: SL/X.pm Verwendung von Exception::Lite anstelle von ExceptionClass wie im Kundenprojekt. --- SL/DB/Object/Hooks.pm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/SL/DB/Object/Hooks.pm b/SL/DB/Object/Hooks.pm index e47951407..ac3b0a2e6 100644 --- a/SL/DB/Object/Hooks.pm +++ b/SL/DB/Object/Hooks.pm @@ -44,11 +44,10 @@ sub run_hooks { foreach my $sub (@{ ( $hooks{$when} || { })->{ ref($object) } || [ ] }) { my $result = ref($sub) eq 'CODE' ? $sub->($object, @args) : $object->call_sub($sub, @args); - die SL::X::DBHookError->new( - hook => (ref($sub) eq 'CODE' ? '' : $sub), - when => $when, - object => $object, - ) if !$result; + die SL::X::DBHookError->new(when => $when, + hook => (ref($sub) eq 'CODE' ? '' : $sub), + object => $object) + if !$result; } } @@ -122,8 +121,8 @@ C function names above. An exception of C is thrown if any of the hooks returns a falsish value. -This function is supposed to be called by L, -L or L. +This function is supposed to be called by L, +L or L. =back -- 2.20.1