my ($result, $exception);
my $worker = sub {
- SL::DB::Object::Hooks::run_hooks($self, 'before_save');
$exception = $EVAL_ERROR unless eval {
+ SL::DB::Object::Hooks::run_hooks($self, 'before_save');
$result = $self->SUPER::save(@args);
+ SL::DB::Object::Hooks::run_hooks($self, 'after_save', $result);
1;
};
- SL::DB::Object::Hooks::run_hooks($self, 'after_save', $result);
return $result;
};
my ($result, $exception);
my $worker = sub {
- SL::DB::Object::Hooks::run_hooks($self, 'before_delete');
$exception = $EVAL_ERROR unless eval {
+ SL::DB::Object::Hooks::run_hooks($self, 'before_delete');
$result = $self->SUPER::delete(@args);
+ SL::DB::Object::Hooks::run_hooks($self, 'after_delete', $result);
1;
};
- SL::DB::Object::Hooks::run_hooks($self, 'after_delete', $result);
return $result;
};