From 6b44875b901ac8d1d7383fed017c973a9f954051 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Sat, 3 Sep 2005 04:12:07 +0000 Subject: Bug 286158: Remove GetSelectableProducts() from globals.pl and use Bugzilla::User::get_selectable_products() instead - Patch by Frédéric Buclin r=joel,kiko a=justdave MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/Component.pm | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'Bugzilla/Component.pm') 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 - 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 -- cgit v1.2.3-24-g4f1b