aboutsummaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-04-02 14:00:18 -0700
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-04-02 14:00:18 -0700
commita9a869f8e20ecfbeafeb8020ad4c1e86b60aa21a (patch)
tree4a0a763f1289cbcce3075505b5f012bb3527b7c2 /extensions
parent07f947c99e162dc991f368cd5ff9065824c4ec86 (diff)
downloadbugs-a9a869f8e20ecfbeafeb8020ad4c1e86b60aa21a.tar
bugs-a9a869f8e20ecfbeafeb8020ad4c1e86b60aa21a.tar.gz
bugs-a9a869f8e20ecfbeafeb8020ad4c1e86b60aa21a.tar.bz2
bugs-a9a869f8e20ecfbeafeb8020ad4c1e86b60aa21a.tar.xz
bugs-a9a869f8e20ecfbeafeb8020ad4c1e86b60aa21a.zip
Bug 556869: New Hook: object_before_delete
r=mkanat, a=mkanat (module owner)
Diffstat (limited to 'extensions')
-rw-r--r--extensions/Example/Extension.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/extensions/Example/Extension.pm b/extensions/Example/Extension.pm
index 835d36f80..26a91b789 100644
--- a/extensions/Example/Extension.pm
+++ b/extensions/Example/Extension.pm
@@ -354,6 +354,18 @@ sub object_before_create {
}
}
+sub object_before_delete {
+ my ($self, $args) = @_;
+
+ my $object = $args->{'object'};
+
+ # Note that this is a made-up class, for this example.
+ if ($object->isa('Bugzilla::ExampleObject')) {
+ my $id = $object->id;
+ warn "An object with id $id is about to be deleted!";
+ }
+}
+
sub object_before_set {
my ($self, $args) = @_;