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/Product.pm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'Bugzilla/Product.pm') diff --git a/Bugzilla/Product.pm b/Bugzilla/Product.pm index c257bd4ce..514620258 100644 --- a/Bugzilla/Product.pm +++ b/Bugzilla/Product.pm @@ -98,8 +98,9 @@ sub components { my $self = shift; if (!defined $self->{components}) { - $self->{components} = + my @components = Bugzilla::Component::get_components_by_product($self->id); + $self->{components} = \@components; } return $self->{components}; } @@ -247,11 +248,11 @@ Bugzilla::Product - Bugzilla product class. my $product = new Bugzilla::Product(1); my $product = new Bugzilla::Product('AcmeProduct'); - my $components = $product->components(); + my @components = $product->components(); my $classification = $product->classification(); - my $hash_ref = $product->group_controls(); - my @array_ref = $product->milestones(); - my @array_ref = $product->versions(); + my $groups_controls = $product->group_controls(); + my @milestones = $product->milestones(); + my @versions = $product->versions(); my $bugcount = $product->bug_count(); my $id = $product->id; @@ -290,12 +291,12 @@ Product.pm represents a product object. =item C - Description: Returns a hash with all product components. + Description: Returns an array of component objects belonging to + the product. Params: none. - Returns: A hash where component id is the hash key and - Bugzilla::Component object is the hash value. + Returns: An array of Bugzilla::Component object. =item C -- cgit v1.2.3-24-g4f1b