diff options
Diffstat (limited to 'Bugzilla/Keyword.pm')
-rw-r--r-- | Bugzilla/Keyword.pm | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/Bugzilla/Keyword.pm b/Bugzilla/Keyword.pm index afa93e1e9..ef044a0c5 100644 --- a/Bugzilla/Keyword.pm +++ b/Bugzilla/Keyword.pm @@ -26,6 +26,7 @@ use constant DB_COLUMNS => qw( keyworddefs.id keyworddefs.name keyworddefs.description + keyworddefs.is_active ); use constant DB_TABLE => 'keyworddefs'; @@ -33,11 +34,13 @@ use constant DB_TABLE => 'keyworddefs'; use constant VALIDATORS => { name => \&_check_name, description => \&_check_description, + is_active => \&_check_is_active, }; use constant UPDATE_COLUMNS => qw( name description + is_active ); ############################### @@ -62,6 +65,7 @@ sub bug_count { sub set_name { $_[0]->set('name', $_[1]); } sub set_description { $_[0]->set('description', $_[1]); } +sub set_is_active { $_[0]->set('is_active', $_[1]); } ############################### #### Subroutines ###### @@ -125,6 +129,10 @@ sub _check_description { return $desc; } +sub _check_is_active { return $_[1] ? 1 : 0 } + +sub is_active { return $_[0]->{is_active} } + 1; __END__ @@ -145,13 +153,13 @@ Bugzilla::Keyword - A Keyword that can be added to a bug. Bugzilla::Keyword represents a keyword that can be added to a bug. -This implements all standard C<Bugzilla::Object> methods. See +This implements all standard C<Bugzilla::Object> methods. See L<Bugzilla::Object> for more details. -=head1 SUBROUTINES +=head1 METHODS -This is only a list of subroutines specific to C<Bugzilla::Keyword>. -See L<Bugzilla::Object> for more subroutines that this object +This is only a list of methods specific to C<Bugzilla::Keyword>. +See L<Bugzilla::Object> for more methods that this object implements. =over @@ -166,6 +174,18 @@ implements. Returns: A reference to an array of Keyword objects, or an empty arrayref if there are no keywords. +=item C<is_active> + + Description: Indicates if the keyword may be used on a bug + Params: none + Returns: a boolean value that is true if the keyword can be applied to bugs. + +=item C<set_is_active($is_active)> + + Description: Set the is_active property to a boolean value + Params: the new value of the is_active property. + Returns: nothing + =back =cut |