From e66bfda7983913ac93247d3e6f993c0ce1bbe7c7 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Tue, 18 Oct 2005 04:43:40 +0000 Subject: Bug 299753: Replace old code in editproducts.cgi by routines from Product.pm - Patch by André Batosti r=LpSolit a=justdave MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/Product.pm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'Bugzilla/Product.pm') diff --git a/Bugzilla/Product.pm b/Bugzilla/Product.pm index 1bf1d4e56..f55b5dd67 100644 --- a/Bugzilla/Product.pm +++ b/Bugzilla/Product.pm @@ -187,6 +187,20 @@ sub bug_count { return $self->{'bug_count'}; } +sub bug_ids { + my $self = shift; + my $dbh = Bugzilla->dbh; + + if (!defined $self->{'bug_ids'}) { + $self->{'bug_ids'} = + $dbh->selectcol_arrayref(q{SELECT bug_id FROM bugs + WHERE product_id = ?}, + undef, $self->id); + } + return $self->{'bug_ids'}; +} + + ############################### #### Accessors ###### ############################### @@ -253,6 +267,7 @@ Bugzilla::Product - Bugzilla product class. my @milestones = $product->milestones(); my @versions = $product->versions(); my $bugcount = $product->bug_count(); + my $bug_ids = $product->bug_ids(); my $id = $product->id; my $name = $product->name; @@ -330,6 +345,14 @@ Product.pm represents a product object. Returns: Integer with the number of bugs. +=item C + + Description: Returns the IDs of bugs that belong to the product. + + Params: none. + + Returns: An array of integer. + =back =head1 SUBROUTINES -- cgit v1.2.3-24-g4f1b