<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title> Bugzilla::Product</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" title="style" type="text/css" href=".././../../../style.css" media="all" > </head> <body id="pod"> <p class="backlinktop"><b><a name="___top" href="../index.html" accesskey="1" title="All Documents"><<</a></b></p> <h1>Bugzilla::Product</h1> <div class='indexgroup'> <ul class='indexList indexList1'> <li class='indexItem indexItem1'><a href='#NAME'>NAME</a> <li class='indexItem indexItem1'><a href='#SYNOPSIS'>SYNOPSIS</a> <li class='indexItem indexItem1'><a href='#DESCRIPTION'>DESCRIPTION</a> <li class='indexItem indexItem1'><a href='#METHODS'>METHODS</a> <li class='indexItem indexItem1'><a href='#SUBROUTINES'>SUBROUTINES</a> <li class='indexItem indexItem1'><a href='#SEE_ALSO'>SEE ALSO</a> </ul> </div> <h1><a class='u' href='#___top' title='click to go to top of document' name="NAME" >NAME</a></h1> <p>Bugzilla::Product - Bugzilla product class.</p> <h1><a class='u' href='#___top' title='click to go to top of document' name="SYNOPSIS" >SYNOPSIS</a></h1> <pre class="code"> use Bugzilla::Product; my $product = new Bugzilla::Product(1); my $product = new Bugzilla::Product({ name => 'AcmeProduct' }); my @components = $product->components(); my $groups_controls = $product->group_controls(); my @milestones = $product->milestones(); my @versions = $product->versions(); my $bugcount = $product->bug_count(); my $bug_ids = $product->bug_ids(); my $has_access = $product->user_has_access($user); my $flag_types = $product->flag_types(); my $id = $product->id; my $name = $product->name; my $description = $product->description; my isactive = $product->is_active; my votesperuser = $product->votes_per_user; my maxvotesperbug = $product->max_votes_per_bug; my votestoconfirm = $product->votes_to_confirm; my $defaultmilestone = $product->default_milestone; my $classificationid = $product->classification_id; my $allows_unconfirmed = $product->allows_unconfirmed;</pre> <h1><a class='u' href='#___top' title='click to go to top of document' name="DESCRIPTION" >DESCRIPTION</a></h1> <p>Product.pm represents a product object. It is an implementation of <a href="../Bugzilla/Object.html" class="podlinkpod" >Bugzilla::Object</a>, and thus provides all methods that <a href="../Bugzilla/Object.html" class="podlinkpod" >Bugzilla::Object</a> provides.</p> <p>The methods that are specific to <code class="code">Bugzilla::Product</code> are listed below.</p> <h1><a class='u' href='#___top' title='click to go to top of document' name="METHODS" >METHODS</a></h1> <dl> <dt><a name="components" ><code class="code">components</code></a></dt> <dd> <pre class="code"> Description: Returns an array of component objects belonging to the product. Params: none. Returns: An array of Bugzilla::Component object.</pre> <dt><a name="group_controls()" ><code class="code">group_controls()</code></a></dt> <dd> <pre class="code"> Description: Returns a hash (group id as key) with all product group controls. Params: $full_data (optional, false by default) - when true, the number of bugs per group applicable to the product is also returned. Moreover, bug groups which have no special settings for the product are also returned. Returns: A hash with group id as key and hash containing a Bugzilla::Group object and the properties of group relative to the product.</pre> <dt><a name="groups_mandatory_for" ><code class="code">groups_mandatory_for</code></a></dt> <dd> <dl> <dt><a name="Description" ><b>Description</b></a></dt> <dd> <p>Tells you what groups are mandatory for bugs in this product.</p> <dt><a name="Params" ><b>Params</b></a></dt> <dd> <p><code class="code">$user</code> - The user who you want to check.</p> <dt><a name="Returns_An_arrayref_of_Bugzilla::Group_objects." ><b>Returns</b> An arrayref of <code class="code">Bugzilla::Group</code> objects.</a></dt> </dl> <dt><a name="groups_valid" ><code class="code">groups_valid</code></a></dt> <dd> <dl> <dt><a name="Description" ><b>Description</b></a></dt> <dd> <p>Returns an arrayref of <a href="../Bugzilla/Group.html" class="podlinkpod" >Bugzilla::Group</a> objects, representing groups that bugs could validly be restricted to within this product. Used mostly by <a href="../Bugzilla/Bug.html" class="podlinkpod" >Bugzilla::Bug</a> to assure that you're adding valid groups to a bug.</p> <p><b>Note</b>: This doesn't check whether or not the current user can add/remove bugs to/from these groups. It just tells you that bugs <i>could be in</i> these groups, in this product.</p> <dt><a name="Params_(none)" ><b>Params</b> (none)</a></dt> <dd> <dt><a name="Returns_An_arrayref_of_Bugzilla::Group_objects." ><b>Returns</b> An arrayref of <a href="../Bugzilla/Group.html" class="podlinkpod" >Bugzilla::Group</a> objects.</a></dt> </dl> <dt><a name="versions" ><code class="code">versions</code></a></dt> <dd> <pre class="code"> Description: Returns all valid versions for that product. Params: none. Returns: An array of Bugzilla::Version objects.</pre> <dt><a name="milestones" ><code class="code">milestones</code></a></dt> <dd> <pre class="code"> Description: Returns all valid milestones for that product. Params: none. Returns: An array of Bugzilla::Milestone objects.</pre> <dt><a name="bug_count()" ><code class="code">bug_count()</code></a></dt> <dd> <pre class="code"> Description: Returns the total of bugs that belong to the product. Params: none. Returns: Integer with the number of bugs.</pre> <dt><a name="bug_ids()" ><code class="code">bug_ids()</code></a></dt> <dd> <pre class="code"> Description: Returns the IDs of bugs that belong to the product. Params: none. Returns: An array of integer.</pre> <dt><a name="user_has_access()" ><code class="code">user_has_access()</code></a></dt> <dd> <pre class="code"> Description: Tells you whether or not the user is allowed to enter bugs into this product, based on the C<entry> group control. To see whether or not a user can actually enter a bug into a product, use C<$user-&gt;can_enter_product>. Params: C<$user> - A Bugzilla::User object. Returns C<1> If this user's groups allow him C<entry> access to this Product, C<0> otherwise.</pre> <dt><a name="flag_types()" ><code class="code">flag_types()</code></a></dt> <dd> <pre class="code"> Description: Returns flag types available for at least one of its components. Params: none. Returns: Two references to an array of flagtype objects.</pre> </dd> </dl> <h1><a class='u' href='#___top' title='click to go to top of document' name="SUBROUTINES" >SUBROUTINES</a></h1> <dl> <dt><a name="preload" ><code class="code">preload</code></a></dt> <dd> <p>When passed an arrayref of <code class="code">Bugzilla::Product</code> objects, preloads their <a href="#milestones" class="podlinkpod" >"milestones"</a>, <a href="#components" class="podlinkpod" >"components"</a>, and <a href="#versions" class="podlinkpod" >"versions"</a>, which is much faster than calling those accessors on every item in the array individually.</p> <p>This function is not exported, so must be called like <code class="code">Bugzilla::Product::preload($products)</code>.</p> <dt><a name="check_product($product_name)" ><code class="code">check_product($product_name)</code></a></dt> <dd> <pre class="code"> Description: Checks if the product name was passed in and if is a valid product. Params: $product_name - String with a product name. Returns: Bugzilla::Product object.</pre> </dd> </dl> <h1><a class='u' href='#___top' title='click to go to top of document' name="SEE_ALSO" >SEE ALSO</a></h1> <p><a href="../Bugzilla/Object.html" class="podlinkpod" >Bugzilla::Object</a></p> <p class="backlinkbottom"><b><a name="___bottom" href="../index.html" title="All Documents"><<</a></b></p> <!-- end doc --> </body></html>