<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Thu May 23 14:25:18 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+10032+AND+labels+%3D+%22Query%2C%22&tempMax=1000&field=key&field=summary
-->
<!-- If you wish to do custom client-side styling of RSS, uncomment this:
<?xml-stylesheet href="http://www.doctrine-project.org/jira/styles/jiraxml2html.xsl" type="text/xsl"?>
-->
<rss version="0.92">
    <channel>
        <title>Doctrine Project</title>
        <link>http://www.doctrine-project.org/jira/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=project+%3D+10032+AND+labels+%3D+%22Query%2C%22</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="1" total="1"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DDC-2140] [GH-512] Added addParameters() to Query and QueryBuilder</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2140</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;This issue is created automatically through a Github pull request on behalf of jappie:&lt;/p&gt;

&lt;p&gt;  Url: &lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/512&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/512&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Message:&lt;/p&gt;

&lt;p&gt;This method behaves like &lt;tt&gt;setParameters()&lt;/tt&gt; before version 2.3:&lt;br/&gt;
It will add new parameters to the collection, and override any existing positions/names.&lt;/p&gt;

&lt;p&gt;It can take a &lt;tt&gt;Doctrine\Common\Collections\ArrayCollection&lt;/tt&gt; with &lt;tt&gt;Doctrine\ORM\Query\Parameter&lt;/tt&gt; objects, as well as a plain &lt;tt&gt;array&lt;/tt&gt; with key/value pairs, as argument.&lt;/p&gt;

&lt;p&gt;This will greatly ease the upgrade to Doctrine 2.3, because you only need to perform a project-wide replace of &lt;tt&gt;setParameters&lt;/tt&gt; with &lt;tt&gt;addParameters&lt;/tt&gt;, in stead of going into your code and determine if calls to &lt;tt&gt;setParameters&lt;/tt&gt; are ok or need refactoring.&lt;/p&gt;

&lt;p&gt;I&apos;ve also added unit-tests to maintain integrity.&lt;/p&gt;</description>
                <environment>OS X 10.8.2, PHP 5.3.18, Nginx 1.2.4 (php through FPM)</environment>
            <key id="14218">DDC-2140</key>
            <summary>[GH-512] Added addParameters() to Query and QueryBuilder</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                        <label>Query,</label>
                        <label>QueryBuilder</label>
                    </labels>
                <created>Tue, 13 Nov 2012 08:51:04 +0000</created>
                <updated>Tue, 20 Nov 2012 08:06:05 +0000</updated>
                                    <version>2.3</version>
                <version>Git Master</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19008" author="beberlei" created="Tue, 20 Nov 2012 02:50:39 +0000"  >&lt;p&gt;A related Github Pull-Request &lt;span class=&quot;error&quot;&gt;&amp;#91;GH-512&amp;#93;&lt;/span&gt; was closed&lt;br/&gt;
&lt;a href=&quot;https://github.com/doctrine/doctrine2/pull/512&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/pull/512&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="19011" author="jasper@nerdsweide.nl" created="Tue, 20 Nov 2012 08:06:05 +0000"  >&lt;blockquote&gt;
&lt;p&gt;I don&apos;t feel strong need to have such an API.&lt;br/&gt;
If you want to keep track and merge collection of parameters, all you have to do is create an array (or an ArrayCollection), manipulate the instance and then setParameters at the end.&lt;br/&gt;
Unless you give me a stronger argument, this code won&apos;t be in. Closing for now.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Hi Guilherme,&lt;/p&gt;

&lt;p&gt;I agree that such a method makes less sense in &lt;tt&gt;Query&lt;/tt&gt;, because when you write a DQL string all parameters are known at once. But when using the &lt;tt&gt;QueryBuilder&lt;/tt&gt; you might need different parameters in different cases, so &lt;tt&gt;addParameters()&lt;/tt&gt; becomes useful there.&lt;/p&gt;

&lt;p&gt;I guess it&apos;s just a convenience method, like IMHO &lt;tt&gt;setParameter()&lt;/tt&gt; is. (You could just do &lt;tt&gt;$qb-&amp;gt;getParameters()-&amp;gt;add()&lt;/tt&gt;)&lt;/p&gt;

&lt;p&gt;The main reason for adding the method was, like I said, upgrading to Doctrine 2.3. I&apos;ve already upgraded all my projects to Doctrine 2.3, so the method is less useful for me now. But it took me a full day to refactor my repositories, because there is no safe way to automate the process. A simple search-and-replace &lt;tt&gt;setParameters()&lt;/tt&gt; to &lt;tt&gt;addParameters()&lt;/tt&gt; would have taken me 5 minutes &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;I&apos;m content with your decision.&lt;br/&gt;
If others find &lt;tt&gt;addParameters()&lt;/tt&gt; useful, I hope they let us know.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>