From: endico%mozilla.org <> Date: Tue, 13 Jun 2000 16:45:12 +0000 (+0000) Subject: adding toArrayOfStrings subroutine needed by Bug.pm X-Git-Tag: bugzilla-2.12~274 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09ac5d13cfe25f44900eb8c6c4f4eefb3be385ef;p=thirdparty%2Fbugzilla.git adding toArrayOfStrings subroutine needed by Bug.pm --- diff --git a/Bugzilla/RelationSet.pm b/Bugzilla/RelationSet.pm index ee402e7a4b..92e2158f22 100644 --- a/Bugzilla/RelationSet.pm +++ b/Bugzilla/RelationSet.pm @@ -196,6 +196,20 @@ sub toArray { return keys(%$self); } +# return this set as an array of strings +# +sub toArrayOfStrings { + ($#_ == 0) || confess("invalid number of arguments"); + my $self = shift(); + + my @result = (); + foreach my $i ( keys %$self ) { + push @result, &::DBID_to_name($i); + } + + return sort(@result); +} + # return this set in string form (comma-separated and sorted) # sub toString { diff --git a/RelationSet.pm b/RelationSet.pm index ee402e7a4b..92e2158f22 100644 --- a/RelationSet.pm +++ b/RelationSet.pm @@ -196,6 +196,20 @@ sub toArray { return keys(%$self); } +# return this set as an array of strings +# +sub toArrayOfStrings { + ($#_ == 0) || confess("invalid number of arguments"); + my $self = shift(); + + my @result = (); + foreach my $i ( keys %$self ) { + push @result, &::DBID_to_name($i); + } + + return sort(@result); +} + # return this set in string form (comma-separated and sorted) # sub toString {