summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Product.pm
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-10-18 06:43:40 +0200
committerlpsolit%gmail.com <>2005-10-18 06:43:40 +0200
commite66bfda7983913ac93247d3e6f993c0ce1bbe7c7 (patch)
tree3023093aca4143eed6933b9e28d909efa178d9d8 /Bugzilla/Product.pm
parent97916f9a31574776b13b975ee87f0483cd65fa9b (diff)
downloadbugzilla-e66bfda7983913ac93247d3e6f993c0ce1bbe7c7.tar.gz
bugzilla-e66bfda7983913ac93247d3e6f993c0ce1bbe7c7.tar.xz
Bug 299753: Replace old code in editproducts.cgi by routines from Product.pm - Patch by André Batosti <batosti@async.com.br> r=LpSolit a=justdave
Diffstat (limited to 'Bugzilla/Product.pm')
-rw-r--r--Bugzilla/Product.pm23
1 files changed, 23 insertions, 0 deletions
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<bug_ids()>
+
+ Description: Returns the IDs of bugs that belong to the product.
+
+ Params: none.
+
+ Returns: An array of integer.
+
=back
=head1 SUBROUTINES