summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Hook.pm
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-02-11 01:00:32 +0100
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-02-11 01:00:32 +0100
commitf6fc02e572ba07782a272e8fc8f9f45e13ba4896 (patch)
treef88912a82e4a85661d61716e5f3975ea35ed838b /Bugzilla/Hook.pm
parent80477beb472a83f6fa711358372db9edf6209c39 (diff)
downloadbugzilla-f6fc02e572ba07782a272e8fc8f9f45e13ba4896.tar.gz
bugzilla-f6fc02e572ba07782a272e8fc8f9f45e13ba4896.tar.xz
Bug 545524: New Hook: object_validators
r=mkanat, a=mkanat (module owner)
Diffstat (limited to 'Bugzilla/Hook.pm')
-rw-r--r--Bugzilla/Hook.pm26
1 files changed, 26 insertions, 0 deletions
diff --git a/Bugzilla/Hook.pm b/Bugzilla/Hook.pm
index 13e435e86..faef9f07d 100644
--- a/Bugzilla/Hook.pm
+++ b/Bugzilla/Hook.pm
@@ -675,6 +675,32 @@ L<Bugzilla::Object/update> returns.
=back
+=head2 object_validators
+
+Allows you to add new items to L<Bugzilla::Object/VALIDATORS> for
+particular classes.
+
+Params:
+
+=over
+
+=item C<class>
+
+The name of the class that C<VALIDATORS> was called on. You can check this
+like C<< if ($class->isa('Some::Class')) >> in your code, to add
+validators only for certain classes
+
+=item C<validators>
+
+A hashref, where the keys are database columns and the values are subroutine
+references. You can add new validators or modify existing ones. If you modify
+an existing one, you should remember to call the original validator
+inside of your modified validator. (This way, several extensions can all
+modify the same validator.)
+
+=back
+
+
=head2 page_before_template
This is a simple way to add your own pages to Bugzilla. This hooks C<page.cgi>,