Commit 21fde55c authored by Koosha Khajeh Moogahi's avatar Koosha Khajeh Moogahi Committed by Frédéric Buclin

Bug 783866: Add support to call Bugzilla::Milestone->check({ id => $id })

r/a=LpSolit
parent c3d86302
...@@ -65,7 +65,7 @@ sub new { ...@@ -65,7 +65,7 @@ sub new {
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
my $product; my $product;
if (ref $param) { if (ref $param and !defined $param->{id}) {
$product = $param->{product}; $product = $param->{product};
my $name = $param->{name}; my $name = $param->{name};
if (!defined $product) { if (!defined $product) {
...@@ -242,7 +242,9 @@ Bugzilla::Milestone - Bugzilla product milestone class. ...@@ -242,7 +242,9 @@ Bugzilla::Milestone - Bugzilla product milestone class.
use Bugzilla::Milestone; use Bugzilla::Milestone;
my $milestone = new Bugzilla::Milestone({ name => $name, product => $product }); my $milestone = new Bugzilla::Milestone({ name => $name, product => $product_obj });
my $milestone = Bugzilla::Milestone->check({ name => $name, product => $product_obj });
my $milestone = Bugzilla::Milestone->check({ id => $id });
my $name = $milestone->name; my $name = $milestone->name;
my $product_id = $milestone->product_id; my $product_id = $milestone->product_id;
...@@ -266,7 +268,7 @@ Milestone.pm represents a Product Milestone object. ...@@ -266,7 +268,7 @@ Milestone.pm represents a Product Milestone object.
=over =over
=item C<new({name => $name, product => $product})> =item C<< new({name => $name, product => $product}) >>
Description: The constructor is used to load an existing milestone Description: The constructor is used to load an existing milestone
by passing a product object and a milestone name. by passing a product object and a milestone name.
...@@ -356,7 +358,7 @@ Milestone.pm represents a Product Milestone object. ...@@ -356,7 +358,7 @@ Milestone.pm represents a Product Milestone object.
=over =over
=item C<create({value => $value, product => $product, sortkey => $sortkey})> =item C<< create({value => $value, product => $product, sortkey => $sortkey}) >>
Description: Create a new milestone for the given product. Description: Create a new milestone for the given product.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment