diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-04-02 23:00:18 +0200 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-04-02 23:00:18 +0200 |
commit | a9a869f8e20ecfbeafeb8020ad4c1e86b60aa21a (patch) | |
tree | 4a0a763f1289cbcce3075505b5f012bb3527b7c2 /extensions/Example | |
parent | 07f947c99e162dc991f368cd5ff9065824c4ec86 (diff) | |
download | bugzilla-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.pm | 12 |
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) = @_; |