5.7.232. Bugzilla::Extension::SubComponents::RHSubComponent

5.7.232.1. NAME

Bugzilla::Extension::SubComponents::RHSubComponent - Bugzilla sub component class.

5.7.232.2. SYNOPSIS

use Bugzilla::Extension::SubComponents::RHSubComponent;

my $sub_component = new Bugzilla::Extension::SubComponents::RHSubComponent($comp_id);

my $bug_count            = $sub_component->bug_count();
my $bug_ids              = $sub_component->bug_ids();
my $id                   = $sub_component->id;
my $name                 = $sub_component->name;
my $description          = $sub_component->description;
my $component_id         = $sub_component->component_id;
my $default_assignee     = $sub_component->default_assignee;
my $default_qa_contact   = $sub_component->default_qa_contact;
my $default_docs_contact = $sub_component->default_docs_contact;
my $initial_cc           = $sub_component->initial_cc;
my $is_active            = $sub_component->is_active;
my $parent_id            = $sub_component->parent_id;
my $level                = $sub_component->level;
my $full_name            = $sub_component->full_name;
my $sortkey              = $sub_component->sortkey;
my $parent               = $sub_component->sortkey;
my $name_tree            = $sub_component->sortkey;
my $children             = $sub_component->sortkey;
my $component            = $sub_component->component;

my $sub_component =
  Bugzilla::Extension::SubComponents::RHSubComponent->create({
                                name             => $name,
                                component        => $component,
                                initialowner     => $user_login1,
                                initialqacontact => $user_login2,
                                initialdocscontact => $user_login3,
                                description      => $description});

$sub_component->set_name($new_name);
$sub_component->set_description($new_description);
$sub_component->set_default_assignee($new_login_name);
$sub_component->set_default_qa_contact($new_login_name);
$sub_component->set_default_docs_contact($new_login_name);
$sub_component->set_cc_list(\@new_login_names);
$sub_component->set_sortkey($new_sortkey);
$sub_component->update();

$sub_component->remove_from_db;

5.7.232.3. DESCRIPTION

RHSubComponent.pm represents a Sub Component object.

5.7.232.4. METHODS

  • new($id)
Description: The constructor is used to load an existing sub component
             by passing a sub component id.

Params:      $id - The id of the sub component you want to load

Returns:     A Bugzilla::Extension::SubComponents::RHSubComponent object.
  • bug_count()
Description: Returns the total of bugs that belong to the sub component.

Params:      none.

Returns:     Integer with the number of bugs.
  • bug_ids()
Description: Returns all bug IDs that belong to the sub component.

Params:      none.

Returns:     A reference to an array of bug IDs.
  • default_assignee()
Description: Returns a user object that represents the default assignee for
             the sub component.

Params:      none.

Returns:     A Bugzilla::User object.
  • default_qa_contact()
Description: Returns a user object that represents the default QA contact for
             the sub component.

Params:      none.

Returns:     A Bugzilla::User object if the default QA contact is defined for
             the sub component. Otherwise, returns undef.
  • default_docs_contact()
Description: Returns a user object that represents the default Docs contact for
             the sub component.

Params:      none.

Returns:     A Bugzilla::User object if the default Docs contact is defined for
             the sub component. Otherwise, returns undef.
  • initial_cc
Description: Returns a list of user objects representing users being
             in the initial CC list.

Params:      none.

Returns:     An arrayref of L<Bugzilla::User> objects.
  • parent_id()
Description: Returns the id of the parent sub component of this sub component.

Params:      none.

Returns:     The id of the parent sub component, or undef if there is no parent.
  • parent()
Description: Returns the parent sub component the sub component belongs to.

Params:      none.

Returns:     A Bugzilla::Extension::SubComponents::RHSubComponent object,
             or undef if there is no parent.
  • children()
Description: Returns the child sub components of this sub component.

Params:      none.

Returns:     A arrayref of Bugzilla::Extension::SubComponents::RHSubComponent
             objects, or an empty arrayref if there are no children.
  • full_name()
Description: Returns the full name of the sub component.

Params:      none.

Returns:     A string. Levels are separated with a space
  • name_tree()
Description: Returns the full name of the sub component.

Params:      none.

Returns:     An array ref of the full name of the tree
  • level()
Description: Returns the level of the sub component

Params:      none.

Returns:     An integer. 0 is the top level, 1 means it has one parent, and
             so on.
  • component()
Description: Returns the component the sub component belongs to.

Params:      none.

Returns:     A Bugzilla::Component object.
  • set_name($new_name)
Description: Changes the name of the sub component.

Params:      $new_name - new name of the sub component (string). This name
                         must be unique within the component and sub
                         component level.

Returns:     Nothing.
  • set_description($new_desc)
Description: Changes the description of the sub component.

Params:      $new_desc - new description of the sub component (string).

Returns:     Nothing.
  • set_default_assignee($new_assignee)
Description: Changes the default assignee of the sub component.

Params:      $new_owner - login name of the new default assignee of
                          the sub component (string). This user account
                          must already exist.

Returns:     Nothing.
  • set_default_qa_contact($new_qa_contact)
Description: Changes the default QA contact of the sub component.

Params:      $new_qa_contact - login name of the new QA contact of
                               the sub component (string). This user
                               account must already exist.

Returns:     Nothing.
  • set_default_docs_contact($new_docs_contact)
Description: Changes the default Docs contact of the sub component.

Params:      $new_docs_contact - login name of the new Docs contact of
                               the sub component (string). This user
                               account must already exist.

Returns:     Nothing.
  • set_cc_list(\@cc_list)
Description: Changes the list of users being in the CC list by default.

Params:      \@cc_list - list of login names (string). All the user
                         accounts must already exist.

Returns:     Nothing.
  • set_sortkey($new_sortkey)
Description: Changes the sortkey of the sub component.

Params:      $new_sortkey - new sortkey of the sub component (signed integer).

Returns:     Nothing.
  • update()
Description: Write changes made to the sub component into the DB.

Params:      none.

Returns:     A hashref with changes made to the sub component object.
  • remove_from_db()
Description: Deletes the current sub component from the DB. The object itself
             is not destroyed. Any bugs with this sub component will have
             their sub component removed.

Params:      none.

Returns:     Nothing.

5.7.232.5. CLASS METHODS

  • create(\%params)
Description: Create a new sub component for the given product.

Params:      The hashref must have the following keys:
             name             - name of the new sub component (string). This
                                name must be unique within the parent
                                sub component (or component at the top level)
             component        - a Bugzilla::Component object to which
                                the Sub component is being added.
             description      - description of the new sub component (string).
             initialowner     - login name of the default assignee (string).
             The following keys are optional:
             initialqacontact - login name of the default QA contact (string),
                                or an empty string to clear it.
             initialdocscontact - login name of the default Docs contact (string),
                                  or an empty string to clear it.
             initial_cc       - an arrayref of login names to add to the
                                CC list by default.

Returns:     A Bugzilla::Extension::SubComponents::RHSubComponent object.

This documentation undoubtedly has bugs; if you find some, please file them here.