<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sat May 18 07:25:16 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://doctrine-project.org/jira/si/jira.issueviews:issue-xml/DDC-2080/DDC-2080.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

<item>
            <title>[DDC-2080] Entity&apos;s association changes after first call</title>
                <link>http://doctrine-project.org/jira/browse/DDC-2080</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;i am using the latest version of doctrine: 2.3&lt;/p&gt;

&lt;p&gt;when you call a generated association function, the first time everything is fine:&lt;/p&gt;

&lt;p&gt;$authors = $book-&amp;gt;getBookToAuthors();&lt;br/&gt;
//$authors = array(5)&lt;br/&gt;
but the second time instead of returning the array of all associations it returns the last hydrated entity:&lt;/p&gt;

&lt;p&gt;$authors = $book-&amp;gt;getBookToAuthors();&lt;br/&gt;
//$authors = BookToAuthor entity&lt;br/&gt;
that happens even when there is nothing else happening:&lt;/p&gt;

&lt;p&gt;$authors = $book-&amp;gt;getBookToAuthors(); //will work&lt;br/&gt;
$authors = $book-&amp;gt;getBookToAuthors(); //won&apos;t work&lt;br/&gt;
the function of getBookToAuthors() is:&lt;/p&gt;

&lt;p&gt;public function getBookToAuthors()&lt;/p&gt;
{
    return $this-&amp;gt;bookToAuthors;
}
&lt;p&gt;and the mapping is as follows:&lt;/p&gt;

&lt;p&gt;/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@var BookToAuthor[]&lt;br/&gt;
 *&lt;/li&gt;
	&lt;li&gt;@OneToMany(targetEntity=&quot;BookToAuthor&quot;, mappedBy=&quot;book&quot;, cascade=
{&quot;persist&quot;}
&lt;p&gt;)&lt;/p&gt;&lt;/li&gt;
	&lt;li&gt;@JoinColumn(name=&quot;id&quot;, referencedColumnName=&quot;book_id&quot;, onDelete=&quot;cascade&quot;)&lt;br/&gt;
 */&lt;br/&gt;
private $bookToAuthors;&lt;br/&gt;
please advise. i don&apos;t know what to do... &lt;img class=&quot;emoticon&quot; src=&quot;http://doctrine-project.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
            <key id="14130">DDC-2080</key>
            <summary>Entity&apos;s association changes after first call</summary>
                <type id="1" iconUrl="http://doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="5" iconUrl="http://doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="5" iconUrl="http://doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="iamkoby">Koby Soto</reporter>
                        <labels>
                    </labels>
                <created>Mon, 15 Oct 2012 14:55:51 +0000</created>
                <updated>Mon, 15 Oct 2012 15:02:55 +0000</updated>
                    <resolved>Mon, 15 Oct 2012 15:02:06 +0000</resolved>
                            <version>2.3</version>
                                <fixVersion>2.3</fixVersion>
                <fixVersion>2.3.1</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="18838" author="iamkoby" created="Mon, 15 Oct 2012 15:02:06 +0000"  >&lt;p&gt;sorry sorry sorry&lt;br/&gt;
it was a mistake in the association target side.&lt;/p&gt;

&lt;p&gt;the target had One-To-One association instead of Many-To-One&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>