summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Component.pm
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-09-03 06:12:07 +0200
committerlpsolit%gmail.com <>2005-09-03 06:12:07 +0200
commit6b44875b901ac8d1d7383fed017c973a9f954051 (patch)
tree0b43db0b62321cc03c91caad4810d4660c2fd56c /Bugzilla/Component.pm
parent3c36f0414886baad1a59db8d0dbd0efd3fec2254 (diff)
downloadbugzilla-6b44875b901ac8d1d7383fed017c973a9f954051.tar.gz
bugzilla-6b44875b901ac8d1d7383fed017c973a9f954051.tar.xz
Bug 286158: Remove GetSelectableProducts() from globals.pl and use Bugzilla::User::get_selectable_products() instead - Patch by Frédéric Buclin <LpSolit@gmail.com> r=joel,kiko a=justdave
Diffstat (limited to 'Bugzilla/Component.pm')
-rw-r--r--Bugzilla/Component.pm15
1 files changed, 6 insertions, 9 deletions
diff --git a/Bugzilla/Component.pm b/Bugzilla/Component.pm
index a3278dea9..dfbcf00a8 100644
--- a/Bugzilla/Component.pm
+++ b/Bugzilla/Component.pm
@@ -121,11 +121,11 @@ sub get_components_by_product {
SELECT id FROM components
WHERE product_id = ?}, undef, $product_id);
- my $components;
+ my @components;
foreach my $id (@$ids) {
- $components->{$id} = new Bugzilla::Component($id);
+ push @components, new Bugzilla::Component($id);
}
- return $components;
+ return @components;
}
1;
@@ -151,8 +151,7 @@ Bugzilla::Component - Bugzilla product component class.
my $default_assignee = $component->default_assignee;
my $default_qa_contact = $component->default_qa_contact;
- my $hash_ref = Bugzilla::Component::get_components_by_product(1);
- my $component = $hash_ref->{1};
+ my @components = Bugzilla::Component::get_components_by_product($id);
=head1 DESCRIPTION
@@ -184,13 +183,11 @@ Component.pm represents a Product Component object.
=item C<get_components_by_product($product_id)>
- Description: Returns all Bugzilla components that belong to the
- supplied product.
+ Description: Returns all components that belong to the supplied product.
Params: $product_id - Integer with a Bugzilla product id.
- Returns: A hash with component id as key and Bugzilla::Component
- object as value.
+ Returns: An array of Bugzilla::Component objects.
=back