<<

# Bugzilla::Version

- NAME
- SYNOPSIS
- DESCRIPTION
- METHODS
- SUBROUTINES

# NAME

Bugzilla::Version - Bugzilla product version class.

# SYNOPSIS

        use Bugzilla::Version;

        my $version = new Bugzilla::Version(1, 'version_value');

        my $product_id = $version->product_id;
        my $value = $version->value;

        $version->remove_from_db;

        my $updated = $version->update($version_name, $product);

        my $version = $hash_ref->{'version_value'};

        my $version = Bugzilla::Version::check_version($product_obj,
                                                       'acme_version');

        my $version = Bugzilla::Version::create($version_name, $product);

# DESCRIPTION

Version.pm represents a Product Version object.

# METHODS

`new($product_id, $value)`

       Description: The constructor is used to load an existing version
                    by passing a product id and a version value.

       Params:      $product_id - Integer with a product id.
                    $value - String with a version value.

       Returns:     A Bugzilla::Version object.

`bug_count()`

       Description: Returns the total of bugs that belong to the version.

       Params:      none.

       Returns:     Integer with the number of bugs.

`remove_from_db()`

       Description: Removes the version from the database.

       Params:      none.

       Retruns:     none.

`update($name, $product)`

       Description: Update the value of the version.

       Params:      $name - String with the new version value.
                    $product - Bugzilla::Product object the version belongs to.

       Returns:     An integer - 1 if the version has been updated, else 0.

# SUBROUTINES

`check_version($product, $version_name)`

       Description: Checks if the version name exists for the product name.

       Params:      $product - A Bugzilla::Product object.
                    $version_name - String with a version name.

       Returns:     Bugzilla::Version object.

`create($version_name, $product)`

       Description: Create a new version for the given product.

       Params:      $version_name - String with a version value.
                    $product - A Bugzilla::Product object.

       Returns:     A Bugzilla::Version object.

<<