Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision af56ae02

Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt

  • ID af56ae02cd83ad4fff35a3ef695a9fcf4c074caf
  • Vorgänger 84e1c3e5
  • Nachfolger 476b6d40

Framework für after/before-Hooks bei load/save/delete

Conflicts:

SL/X.pm

Verwendung von Exception::Lite anstelle von ExceptionClass wie im
Kundenprojekt.

Unterschiede anzeigen:

SL/DB/Object/Hooks.pm
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' ? '<anonymous sub>' : $sub),
when => $when,
object => $object,
) if !$result;
die SL::X::DBHookError->new(when => $when,
hook => (ref($sub) eq 'CODE' ? '<anonymous sub>' : $sub),
object => $object)
if !$result;
}
}
......
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

Auch abrufbar als: Unified diff