Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-updates > by-pkgid > 3b735b44c1e188a44c40f81bded6b6df > files > 849

bugzilla-4.4.12-1.mga5.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <title>
Bugzilla::Search</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">&lt;&lt;</a></b></p>
<h1>Bugzilla::Search</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>
  <ul   class='indexList indexList2'>
    <li class='indexItem indexItem2'><a href='#new'>new</a>
    <li class='indexItem indexItem2'><a href='#data'>data</a>
  </ul>
</ul>
</div>

<h1><a class='u' href='#___top' title='click to go to top of document'
name="NAME"
>NAME</a></h1>

<p>Bugzilla::Search - Provides methods to run queries against bugs.</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::Search;

    my $search = new Bugzilla::Search({&#39;fields&#39; =&#62; \@fields,
                                       &#39;params&#39; =&#62; \%search_criteria,
                                       &#39;sharer&#39; =&#62; $sharer_id,
                                       &#39;user&#39;   =&#62; $user_obj,
                                       &#39;allow_unlimited&#39; =&#62; 1});

    my $data = $search-&#62;data;
    my ($data, $extra_data) = $search-&#62;data;</pre>

<h1><a class='u' href='#___top' title='click to go to top of document'
name="DESCRIPTION"
>DESCRIPTION</a></h1>

<p>Search.pm represents a search object. It&#39;s the single way to collect data about bugs in a secure way. The list of bugs matching criteria defined by the caller are filtered based on the user privileges.</p>

<h1><a class='u' href='#___top' title='click to go to top of document'
name="METHODS"
>METHODS</a></h1>

<h2><a class='u' href='#___top' title='click to go to top of document'
name="new"
>new</a></h2>

<dl>
<dt><a name="Description"
><b>Description</b></a></dt>

<dd>
<p>Create a Bugzilla::Search object.</p>

<dt><a name="Params"
><b>Params</b></a></dt>

<dd>
<dl>
<dt><a name="fields"
><code  class="code">fields</code></a></dt>

<dd>
<p>An arrayref representing the bug attributes for which data is desired. Legal attributes are listed in the fielddefs DB table. At least one field must be defined, typically the &#39;bug_id&#39; field.</p>

<dt><a name="params"
><code  class="code">params</code></a></dt>

<dd>
<p>A hashref representing search criteria. Each key =&#62; value pair represents a search criteria, where the key is the search field and the value is the value for this field. At least one search criteria must be defined if the &#39;search_allow_no_criteria&#39; parameter is turned off, else an error is thrown.</p>

<dt><a name="sharer"
><code  class="code">sharer</code></a></dt>

<dd>
<p>When a saved search is shared by a user, this is his user ID.</p>

<dt><a name="user"
><code  class="code">user</code></a></dt>

<dd>
<p>A <a href="../Bugzilla/User.html" class="podlinkpod"
>Bugzilla::User</a> object representing the user to whom the data is addressed. All security checks are done based on this user object, so it&#39;s not safe to share results of the query with other users as not all users have the same privileges or have the same role for all bugs in the list. If this parameter is not defined, then the currently logged in user is taken into account. If no user is logged in, then only public bugs will be returned.</p>

<dt><a name="allow_unlimited"
><code  class="code">allow_unlimited</code></a></dt>

<dd>
<p>If set to a true value, the number of bugs retrieved by the query is not limited.</p>
</dd>
</dl>

<dt><a name="Returns"
><b>Returns</b></a></dt>

<dd>
<p>A <a href="../Bugzilla/Search.html" class="podlinkpod"
>Bugzilla::Search</a> object.</p>
</dd>
</dl>

<h2><a class='u' href='#___top' title='click to go to top of document'
name="data"
>data</a></h2>

<dl>
<dt><a name="Description"
><b>Description</b></a></dt>

<dd>
<p>Returns bugs matching search criteria passed to <code  class="code">new()</code>.</p>

<dt><a name="Params"
><b>Params</b></a></dt>

<dd>
<p>None</p>

<dt><a name="Returns"
><b>Returns</b></a></dt>

<dd>
<p>In scalar context, this method returns a reference to a list of bugs. Each item of the list represents a bug, which is itself a reference to a list where each item represents a bug attribute, in the same order as specified in the <code  class="code">fields</code> parameter of <code  class="code">new()</code>.</p>

<p>In list context, this methods also returns a reference to a list containing references to hashes. For each hash, two keys are defined: <code  class="code">sql</code> contains the SQL query which has been executed, and <code  class="code">time</code> contains the time spent to execute the SQL query, in seconds. There can be either a single hash, or two hashes if two SQL queries have been executed sequentially to get all the required data.</p>
</dd>
</dl>
<p class="backlinkbottom"><b><a name="___bottom" href="../index.html" title="All Documents">&lt;&lt;</a></b></p>

<!-- end doc -->

</body></html>