projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
with_objects in ParseFilter korrekt weiterreichen
[kivitendo-erp.git]
/
SL
/
DB
/
Object
/
Hooks.pm
diff --git
a/SL/DB/Object/Hooks.pm
b/SL/DB/Object/Hooks.pm
index
0056755
..
371e445
100644
(file)
--- a/
SL/DB/Object/Hooks.pm
+++ b/
SL/DB/Object/Hooks.pm
@@
-44,7
+44,11
@@
sub run_hooks {
foreach my $sub (@{ ( $hooks{$when} || { })->{ ref($object) } || [ ] }) {
my $result = ref($sub) eq 'CODE' ? $sub->($object, @args) : $object->call_sub($sub, @args);
foreach my $sub (@{ ( $hooks{$when} || { })->{ ref($object) } || [ ] }) {
my $result = ref($sub) eq 'CODE' ? $sub->($object, @args) : $object->call_sub($sub, @args);
- SL::X::DBHookError->throw(error => "${when} hook '" . (ref($sub) eq 'CODE' ? '<anonymous sub>' : $sub) . "' failed") if !$result;
+ die SL::X::DBHookError->new(when => $when,
+ hook => (ref($sub) eq 'CODE' ? '<anonymous sub>' : $sub),
+ object => $object,
+ object_type => ref($object))
+ if !$result;
}
}
}
}
@@
-118,8
+122,8
@@
C<after_xyz> function names above.
An exception of C<SL::X::DBHookError> is thrown if any of the hooks
returns a falsish value.
An exception of C<SL::X::DBHookError> is thrown if any of the hooks
returns a falsish value.
-This function is supposed to be called by L<
Rose::DB::Object/load
>,
-L<
Rose::DB::Object/save> or L<Rose::DB::Object/delete
>.
+This function is supposed to be called by L<
SL::DB::Object/"load"
>,
+L<
SL::DB::Object/"save"> or L<SL::DB::Object/"delete"
>.
=back
=back