5.7.34. Bugzilla::Field::ChoiceInterface

5.7.34.1. NAME

Bugzilla::Field::ChoiceInterface - Makes an object act like a Bugzilla::Field::Choice.

5.7.34.2. DESCRIPTION

This is an “interface”, in the Java sense (sometimes called a “Role” or a “Mixin” in other languages). Bugzilla::Field::Choice is the primary implementor of this interface, but other classes also implement it if they want to “act like” Bugzilla::Field::Choice.

5.7.34.3. METHODS

Accessors

These are in addition to the standard Bugzilla::Object accessors.

  • sortkey
The key that determines the sort order of this item.
  • field
The Bugzilla::Field object that this field value belongs to.
  • is_active
Whether or not this value should appear as an option on bugs that do not already have it set as the current value.
  • is_static
0 if this field value can be renamed or deleted, 1 otherwise.
  • is_default
1 if this is the default value for this field, 0 otherwise.
  • bug_count
An integer count of the number of bugs that have this value set.
  • controls_visibility_of_fields
Returns an arrayref of Bugzilla::Field objects, representing any fields whose visibility are controlled by this field value.
  • controlled_values

Tells you which values in other fields appear (become visible) when this value is set in its field.

Returns a hashref of arrayrefs. The hash keys are the names of fields, and the values are arrays of objects that implement Bugzilla::Field::ChoiceInterface, representing values that this value controls the visibility of, for that field.

  • visibility_value
Returns an object that implements Bugzilla::Field::ChoiceInterface, which represents the value that needs to be set in order for this value to appear in the UI.
  • is_visible_on_bug

Returns 1 if, according to the settings of is_active and visibility_value, this value should be displayed as an option when viewing a bug. Returns 0 otherwise.

Takes a single argument, a Bugzilla::Bug object or a hash with similar fields to a Bugzilla::Bug object.

  • is_set_on_bug

Returns 1 if this value is the current value set for its field on the passed-in Bugzilla::Bug object (or a hash that looks like a Bugzilla::Bug). For multi-valued fields, we return 1 if any of the currently selected values are this value.

Returns 0 otherwise.

5.7.34.4. Methods in need of POD

  • FIELD_NAME
  • controlled_values_array

This documentation undoubtedly has bugs; if you find some, please file them here.