diff options
author | mkanat%bugzilla.org <> | 2007-04-19 11:04:54 +0200 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2007-04-19 11:04:54 +0200 |
commit | 29ab35c232fdff053f78b18598bfbe6a13f29826 (patch) | |
tree | 5763e4609f0b96bcd5afbb93fdcc10924f51dc87 /Bugzilla/Field.pm | |
parent | 0e2a60dc182c15159110e996b370fe1640af0fa4 (diff) | |
download | bugzilla-29ab35c232fdff053f78b18598bfbe6a13f29826.tar.gz bugzilla-29ab35c232fdff053f78b18598bfbe6a13f29826.tar.xz |
Bug 372531: "match" should be a generic function in Bugzilla::Object
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'Bugzilla/Field.pm')
-rw-r--r-- | Bugzilla/Field.pm | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/Bugzilla/Field.pm b/Bugzilla/Field.pm index 9177ae423..1830784a9 100644 --- a/Bugzilla/Field.pm +++ b/Bugzilla/Field.pm @@ -487,81 +487,6 @@ sub run_create_validators { =over -=item C<match> - -=over - -=item B<Description> - -Returns a list of fields that match the specified criteria. - -You should be using L<Bugzilla/get_fields> and -L<Bugzilla/get_custom_field_names> instead of this function. - -=item B<Params> - -Takes named parameters in a hashref: - -=over - -=item C<name> - The name of the field. - -=item C<custom> - Boolean. True to only return custom fields. False -to only return non-custom fields. - -=item C<obsolete> - Boolean. True to only return obsolete fields. -False to not return obsolete fields. - -=item C<type> - The type of the field. A C<FIELD_TYPE> constant from -L<Bugzilla::Constants>. - -=item C<enter_bug> - Boolean. True to only return fields that appear -on F<enter_bug.cgi>. False to only return fields that I<don't> appear -on F<enter_bug.cgi>. - -=back - -=item B<Returns> - -A reference to an array of C<Bugzilla::Field> objects. - -=back - -=back - -=cut - -sub match { - my ($class, $criteria) = @_; - - my @terms; - if (defined $criteria->{name}) { - push(@terms, "name=" . Bugzilla->dbh->quote($criteria->{name})); - } - if (defined $criteria->{custom}) { - push(@terms, "custom=" . ($criteria->{custom} ? "1" : "0")); - } - if (defined $criteria->{obsolete}) { - push(@terms, "obsolete=" . ($criteria->{obsolete} ? "1" : "0")); - } - if (defined $criteria->{enter_bug}) { - push(@terms, "enter_bug=" . ($criteria->{enter_bug} ? '1' : '0')); - } - if (defined $criteria->{type}) { - push(@terms, "type = " . $criteria->{type}); - } - my $where = (scalar(@terms) > 0) ? "WHERE " . join(" AND ", @terms) : ""; - - my $ids = Bugzilla->dbh->selectcol_arrayref( - "SELECT id FROM fielddefs $where", {Slice => {}}); - - return $class->new_from_list($ids); -} - -=pod - -=over - =item C<get_legal_field_values($field)> Description: returns all the legal values for a field that has a |