<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sat May 25 07:21:51 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/si/jira.issueviews:issue-xml/DDC-2143/DDC-2143.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.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-2143] $em-&gt;refresh($entity) doesn&apos;t refresh associations cleared with clear()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2143</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;

  &lt;span class=&quot;code-comment&quot;&gt;// $entity-&amp;gt;items is m2m association
&lt;/span&gt;
  &lt;span class=&quot;code-comment&quot;&gt;/////////////////////
&lt;/span&gt;  &lt;span class=&quot;code-comment&quot;&gt;// 1. Bug
&lt;/span&gt;
  echo $entity-&amp;gt;items-&amp;gt;count(); &lt;span class=&quot;code-comment&quot;&gt;// 2
&lt;/span&gt;
  $entity-&amp;gt;items-&amp;gt;clear();

  echo $entity-&amp;gt;items-&amp;gt;count(); &lt;span class=&quot;code-comment&quot;&gt;// 0
&lt;/span&gt;
  $em-&amp;gt;refresh($entity);

  echo $entity-&amp;gt;items-&amp;gt;count(); &lt;span class=&quot;code-comment&quot;&gt;// 0 &amp;lt;-- ???
&lt;/span&gt;
  &lt;span class=&quot;code-comment&quot;&gt;//////////////////
&lt;/span&gt;  &lt;span class=&quot;code-comment&quot;&gt;// 2. Workaround
&lt;/span&gt;
  echo $entity-&amp;gt;items-&amp;gt;count(); &lt;span class=&quot;code-comment&quot;&gt;// 2
&lt;/span&gt;
  &lt;span class=&quot;code-comment&quot;&gt;// remove items one by one
&lt;/span&gt;
  $items = $entity-&amp;gt;items-&amp;gt;toArray();
  foreach ( $items as $item )
  {
    $entity-&amp;gt;items-&amp;gt;removeElement($item);
  }

  echo $entity-&amp;gt;items-&amp;gt;count(); &lt;span class=&quot;code-comment&quot;&gt;// 0
&lt;/span&gt;
  $em-&amp;gt;refresh($entity);

  echo $entity-&amp;gt;items-&amp;gt;count(); &lt;span class=&quot;code-comment&quot;&gt;// 2, as expected
&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>PHP 5.3 + APC, CentOS</environment>
            <key id="14222">DDC-2143</key>
            <summary>$em-&gt;refresh($entity) doesn&apos;t refresh associations cleared with clear()</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="5">Cannot Reproduce</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="drake_jc">Alex</reporter>
                        <labels>
                    </labels>
                <created>Wed, 14 Nov 2012 12:06:30 +0000</created>
                <updated>Wed, 1 May 2013 08:18:02 +0000</updated>
                    <resolved>Wed, 1 May 2013 08:18:02 +0000</resolved>
                            <version>2.3</version>
                                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="19370" author="ocramius" created="Wed, 23 Jan 2013 21:24:18 +0000"  >&lt;p&gt;This is because `clear` on an un-initialized collection doesn&apos;t initialize it. Can you confirm this by adding a call to &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;initialize()&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; in the `clear` method of `Doctrine\ORM\PersistentCollection`?&lt;/p&gt;</comment>
                    <comment id="19381" author="ocramius" created="Wed, 23 Jan 2013 22:11:37 +0000"  >&lt;p&gt;Related to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DDC-1987&quot; title=&quot;Cascading &amp;quot;refresh&amp;quot; does not work on lazy loaded associations&quot;&gt;&lt;del&gt;DDC-1987&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="19576" author="ocramius" created="Thu, 21 Feb 2013 09:54:43 +0000"  >&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/jira/secure/ViewProfile.jspa?name=drake_jc&quot; class=&quot;user-hover&quot; rel=&quot;drake_jc&quot;&gt;Alex&lt;/a&gt; ping? &lt;/p&gt;</comment>
                    <comment id="19906" author="beberlei" created="Sun, 31 Mar 2013 11:05:30 +0000"  >&lt;p&gt;I cannot reproduce this issue, see the testscript attached (put into tests/Doctrine/Tests/ORM/Functional/Ticket/). Can you try to make this code fail?&lt;/p&gt;</comment>
                    <comment id="20133" author="beberlei" created="Wed, 1 May 2013 08:18:02 +0000"  >&lt;p&gt;Closed, no feedback.&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="13971">DDC-1987</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="11513" name="DDC2143Test.php" size="1537" author="beberlei" created="Sun, 31 Mar 2013 11:05:29 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>