5.7.83. Bugzilla::Version¶
5.7.83.1. NAME¶
Bugzilla::Version - Bugzilla product version class.
5.7.83.2. SYNOPSIS¶
use Bugzilla::Version;
my $version = new Bugzilla::Version({ name => $name, product => $product_obj });
my $version = Bugzilla::Version->check({ name => $name, product => $product_obj });
my $version = Bugzilla::Version->check({ id => $id });
my $value = $version->name;
my $product_id = $version->product_id;
my $product = $version->product;
my $version = Bugzilla::Version->create(
{ value => $name, product => $product_obj });
$version->set_value($new_name);
$version->update();
$version->remove_from_db;
5.7.83.3. DESCRIPTION¶
Version.pm represents a Product Version object. It is an implementation of Bugzilla::Object, and thus provides all methods that Bugzilla::Object provides.
The methods that are specific to Bugzilla::Version
are listed
below.
5.7.83.4. METHODS¶
bug_count()
Description
Returns the total of bugs that belong to the version.Params
noneReturns
Integer with the number of bugs.
5.7.83.5. FUNCTIONS¶
vers_cmp($a, $b)
Description
This is a comparison function, like you would use in
sort
, except that it compares two version numbers. So, for example, 2.10 would be greater than 2.2.It's based on versioncmp from Sort::Versions, with some Bugzilla-specific fixes.
Params
$a
and$b
- The versions you want to compare.Returns
-1
if$a
is less than$b
,0
if they are equal, or1
if$a
is greater than$b
.