summaryrefslogtreecommitdiffstats
path: root/extensions/Example
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-04-02 23:00:18 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-04-02 23:00:18 +0200
commita9a869f8e20ecfbeafeb8020ad4c1e86b60aa21a (patch)
tree4a0a763f1289cbcce3075505b5f012bb3527b7c2 /extensions/Example
parent07f947c99e162dc991f368cd5ff9065824c4ec86 (diff)
downloadbugzilla-a9a869f8e20ecfbeafeb8020ad4c1e86b60aa21a.tar.gz
bugzilla-a9a869f8e20ecfbeafeb8020ad4c1e86b60aa21a.tar.xz
Bug 556869: New Hook: object_before_delete
r=mkanat, a=mkanat (module owner)
Diffstat (limited to 'extensions/Example')
-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) = @_;