<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Thu Jun 20 00:00:58 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+MODM+AND+fixVersion+%3D+%221.0.0BETA2%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+MODM+AND+fixVersion+%3D+%221.0.0BETA2%22</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="53" total="53"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[MODM-126] lessThanOrEq() renamed in lte()</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-126</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;The lessThanOrEq() function referenced in the documentation does not exist ay more, it was replaced by lte().&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/docs/mongodb_odm/1.0/en/reference/query-builder-api.html&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/mongodb_odm/1.0/en/reference/query-builder-api.html&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12413">MODM-126</key>
            <summary>lessThanOrEq() renamed in lte()</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</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>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="billybob">Billy Bob</reporter>
                        <labels>
                    </labels>
                <created>Tue, 22 Feb 2011 23:27:07 +0000</created>
                <updated>Tue, 22 Feb 2011 23:27:07 +0000</updated>
                                    <version>1.0.0BETA2</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-123] Single Collection Inheritance : hydration won&apos;t work properly</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-123</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;There is still a problem with Single Collection Inheritance. &lt;/p&gt;

&lt;p&gt;Please consider the following code : &lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
/**
 * @Document(db=&quot;forum&quot;, collection=&quot;Items&quot;)
 * @InheritanceType(&quot;SINGLE_COLLECTION&quot;)
 * @DiscriminatorField(fieldName=&quot;type&quot;)
 * @DiscriminatorMap({0=&quot;Items&quot;, 1=&quot;Stuffs&quot;})
*/
class Items
{
    /**
     *
     * @id
     */
    public $id;

    /**
     * @String
     */
    public $title;
}



/**
 * @Document(db=&quot;forum&quot;, collection=&quot;Items&quot;)
*/
class Stuffs extends Items
{
    
    /**
     *
     * @id
     */
    public $id;

    /**
     * @String
     */
    public $stuffname;

}

$a = new Stuffs();
$a-&amp;gt;stuffname = &apos;TTT&apos;;
$dm-&amp;gt;persist($a);
$dm-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Resulting in the database with :&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
{
   &quot;_id&quot;: ObjectId(&quot;4d5dd082b53251b84e000000&quot;),
   &quot;stuffname&quot;: &quot;TTT&quot;,
   &quot;type&quot;: 1 
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;Now if I do :&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
$result = $dm-&amp;gt;find(&apos;Items&apos;, $a-&amp;gt;id);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;then $result is an instance of &lt;b&gt;Stuffs&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;But if I try :&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
$result = $dm-&amp;gt;find(&apos;Items&apos;, &apos;4d5dd082b53251b84e000000&apos;); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;then $result is an instance of &lt;b&gt;Items&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Note that &apos;$a-&amp;gt;id&apos; is a string, the same string containing &apos;4d5dd082b53251b84e000000&apos;, so :&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
$result = $dm-&amp;gt;find(&apos;Items&apos;, $a-&amp;gt;id); 
$result = $dm-&amp;gt;find(&apos;Items&apos;, &apos;4d5dd082b53251b84e000000&apos;); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;are semantically equivalent. It seems however that hydration would ignore the DiscriminatorMap in the second example. &lt;/p&gt;

&lt;p&gt;However If you do :&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
$result = $dm-&amp;gt;find(&apos;Stuffs&apos;, &apos;4d5dd082b53251b84e000000&apos;); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;You&apos;ll get a &lt;b&gt;Stuffs&lt;/b&gt; as a result. &lt;/p&gt;


&lt;p&gt;Now I tried to find a workaround when you don&apos;t know the type of the returned object. My initial intention was to first fetch a document with :&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
$result = $dm-&amp;gt;find(&apos;Items&apos;, &apos;4d5dd082b53251b84e000000&apos;); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;Then I&apos;m testing a property in the objet to see if it&apos;s a &lt;b&gt;Stuffs&lt;/b&gt;, if it is, I tried an new : &lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
$result = $dm-&amp;gt;find(&apos;Stuffs&apos;, &apos;4d5dd082b53251b84e000000&apos;); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;In order to fetch a &lt;b&gt;Stuffs&lt;/b&gt;. But ... I still get a *Items&quot;!&lt;/p&gt;

&lt;p&gt;So basically, if you do :&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
$result = $dm-&amp;gt;find(&apos;Stuffs&apos;, &apos;4d5dd082b53251b84e000000&apos;); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;You get a &lt;b&gt;Stuffs&lt;/b&gt;. But if you do :&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
$dm-&amp;gt;find(&apos;Items&apos;, &apos;4d5dd082b53251b84e000000&apos;); 
$result = $dm-&amp;gt;find(&apos;Stuffs&apos;, &apos;4d5dd082b53251b84e000000&apos;); 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;You get a &lt;b&gt;Items&lt;/b&gt;!&lt;/p&gt;</description>
                <environment>Mac OS X, MAMP</environment>
            <key id="12403">MODM-123</key>
            <summary>Single Collection Inheritance : hydration won&apos;t work properly</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="billybob">Billy Bob</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Feb 2011 21:10:22 +0000</created>
                <updated>Wed, 23 Feb 2011 23:46:37 +0000</updated>
                    <resolved>Wed, 23 Feb 2011 23:46:37 +0000</resolved>
                            <version>1.0.0BETA2</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15335" author="jwage" created="Fri, 18 Feb 2011 00:58:47 +0000"  >&lt;p&gt;Hi, can you make a phpunit testcase here? &lt;a href=&quot;https://github.com/doctrine/mongodb-odm/tree/master/tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/mongodb-odm/tree/master/tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="15341" author="billybob" created="Fri, 18 Feb 2011 19:15:52 +0000"  >&lt;p&gt;Sorry but I&apos;m not familiar with phpunit. &lt;/p&gt;

&lt;p&gt;If that can help, I&apos;ve made more tests here. Strangely when I deleted all the documents in the test base and created new ones, the hydration then worken properly! However in my real project, the issue is still here ...&lt;/p&gt;

&lt;p&gt;In conclusion it seems that the issue is random. &lt;/p&gt;
</comment>
                    <comment id="15343" author="jwage" created="Sat, 19 Feb 2011 18:15:49 +0000"  >&lt;p&gt;I am not able to produce the issue here. Can you make a executable test that I can run so that I can see what you see?&lt;/p&gt;</comment>
                    <comment id="15366" author="billybob" created="Wed, 23 Feb 2011 23:46:37 +0000"  >&lt;p&gt;Doesn&apos;t seem to be an issue in BETA2.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-121] a call of unknown method &quot;setIdentifierValues&quot; in UnitOfWork class</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-121</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;On DocumentManager::merge() the following error happens:&lt;/p&gt;

&lt;p&gt;Fatal error: Call to undefined method Doctrine\ODM\MongoDB\Mapping\ClassMetadata::setIdentifierValues() in /projects/tbi_doctrine/vendors/doctrine/odm/lib/Doctrine/ODM/MongoDB/UnitOfWork.php on line 1378&lt;/p&gt;
</description>
                <environment></environment>
            <key id="12398">MODM-121</key>
            <summary>a call of unknown method &quot;setIdentifierValues&quot; in UnitOfWork class</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vkaplich">Vitaliy Kaplich</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Feb 2011 19:05:49 +0000</created>
                <updated>Wed, 16 Feb 2011 19:17:56 +0000</updated>
                    <resolved>Wed, 16 Feb 2011 19:17:56 +0000</resolved>
                            <version>1.0.0BETA1</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                <component>UnitOfWork</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15328" author="jwage" created="Wed, 16 Feb 2011 19:17:56 +0000"  >&lt;p&gt;This is already resolve in the latest master in git.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-119] &quot;strategy&quot; property in @Field annotation is not recognized</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-119</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;@Collection(strategy=&quot;set&quot;)&lt;br/&gt;
works fine&lt;/p&gt;

&lt;p&gt;but&lt;br/&gt;
==========================================&lt;/p&gt;

&lt;p&gt;@Field(type=&quot;collection&quot;, strategy=&quot;set&quot;)&lt;br/&gt;
causes error:&lt;br/&gt;
Fatal error: Uncaught exception &apos;BadMethodCallException&apos; with message &apos;Unknown property &apos;strategy&apos; on annotation &apos;Doctrine\ODM\MongoDB\Mapping\Field&apos;.&apos; in /projects/tbi_doctrine/vendors/doctrine/common/lib/Doctrine/Common/Annotations/Annotation.php on line 77&lt;/p&gt;

&lt;p&gt;BadMethodCallException: Unknown property &apos;strategy&apos; on annotation &apos;Doctrine\ODM\MongoDB\Mapping\Field&apos;. in /projects/tbi_doctrine/vendors/doctrine/common/lib/Doctrine/Common/Annotations/Annotation.php on line 77&lt;/p&gt;

&lt;p&gt;Call Stack:&lt;br/&gt;
    0.0007     691072   1. &lt;/p&gt;
{main}
&lt;p&gt;() /projects/tbi_doctrine/lab/doctrine/insert.php:0&lt;br/&gt;
    0.0808    6313168   2. Doctrine\ODM\MongoDB\DocumentManager-&amp;gt;persist() /projects/tbi_doctrine/lab/doctrine/insert.php:34&lt;br/&gt;
    0.0809    6313168   3. Doctrine\ODM\MongoDB\UnitOfWork-&amp;gt;persist() /projects/tbi_doctrine/vendors/doctrine/odm/lib/Doctrine/ODM/MongoDB/DocumentManager.php:338&lt;br/&gt;
    0.0809    6313248   4. Doctrine\ODM\MongoDB\DocumentManager-&amp;gt;getClassMetadata() /projects/tbi_doctrine/vendors/doctrine/odm/lib/Doctrine/ODM/MongoDB/UnitOfWork.php:1177&lt;br/&gt;
    0.0809    6313248   5. Doctrine\ODM\MongoDB\Mapping\ClassMetadataFactory-&amp;gt;getMetadataFor() /projects/tbi_doctrine/vendors/doctrine/odm/lib/Doctrine/ODM/MongoDB/DocumentManager.php:250&lt;br/&gt;
    0.0809    6313248   6. Doctrine\ODM\MongoDB\Mapping\ClassMetadataFactory-&amp;gt;loadMetadata() /projects/tbi_doctrine/vendors/doctrine/odm/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataFactory.php:165&lt;br/&gt;
    0.0957    6734784   7. Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver-&amp;gt;loadMetadataForClass() /projects/tbi_doctrine/vendors/doctrine/odm/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataFactory.php:221&lt;br/&gt;
    0.0978    6669016   8. Doctrine\Common\Annotations\AnnotationReader-&amp;gt;getPropertyAnnotation() /projects/tbi_doctrine/vendors/doctrine/odm/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AnnotationDriver.php:182&lt;br/&gt;
    0.0978    6669016   9. Doctrine\Common\Annotations\AnnotationReader-&amp;gt;getPropertyAnnotations() /projects/tbi_doctrine/vendors/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationReader.php:216&lt;br/&gt;
    0.0979    6669392  10. Doctrine\Common\Annotations\Parser-&amp;gt;parse() /projects/tbi_doctrine/vendors/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationReader.php:201&lt;br/&gt;
    0.0983    6678712  11. Doctrine\Common\Annotations\Parser-&amp;gt;Annotations() /projects/tbi_doctrine/vendors/doctrine/common/lib/Doctrine/Common/Annotations/Parser.php:209&lt;br/&gt;
    0.0983    6678928  12. Doctrine\Common\Annotations\Parser-&amp;gt;Annotation() /projects/tbi_doctrine/vendors/doctrine/common/lib/Doctrine/Common/Annotations/Parser.php:270&lt;br/&gt;
    0.0986    6680200  13. Doctrine\Common\Annotations\Parser-&amp;gt;newAnnotation() /projects/tbi_doctrine/vendors/doctrine/common/lib/Doctrine/Common/Annotations/Parser.php:349&lt;br/&gt;
    0.0986    6680840  14. Doctrine\Common\Annotations\Annotation-&amp;gt;__construct() /projects/tbi_doctrine/vendors/doctrine/common/lib/Doctrine/Common/Annotations/Parser.php:536&lt;br/&gt;
    0.0986    6681624  15. Doctrine\Common\Annotations\Annotation-&amp;gt;__set() /projects/tbi_doctrine/vendors/doctrine/common/lib/Doctrine/Common/Annotations/Annotation.php:0&lt;/p&gt;</description>
                <environment>Cent OS 5.5, PHP 5.3</environment>
            <key id="12372">MODM-119</key>
            <summary>&quot;strategy&quot; property in @Field annotation is not recognized</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vkaplich">Vitaliy Kaplich</reporter>
                        <labels>
                    </labels>
                <created>Thu, 10 Feb 2011 12:30:29 +0000</created>
                <updated>Fri, 11 Feb 2011 13:25:29 +0000</updated>
                    <resolved>Fri, 11 Feb 2011 13:25:29 +0000</resolved>
                            <version>1.0.0BETA1</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15256" author="jwage" created="Fri, 11 Feb 2011 13:25:29 +0000"  >&lt;p&gt;Fixed here &lt;a href=&quot;https://github.com/doctrine/mongodb-odm/commit/b9bd2dcbab3c8ea2ef537fa1301525b3004ba795&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/mongodb-odm/commit/b9bd2dcbab3c8ea2ef537fa1301525b3004ba795&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-118] rename &quot;load&quot; method in Proxy object to &quot;__load__&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-118</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;It would be really great if the method &quot;load&quot; is renamed to something more protected like &quot;__&lt;em&gt;load&lt;/em&gt;&lt;em&gt;&quot; or &quot;&lt;/em&gt;_doctrineOdmLoad&quot; like it has done for public properties &lt;br/&gt;
    public $__dm;&lt;br/&gt;
    public $__identifier;&lt;br/&gt;
    public $_&lt;em&gt;isInitialized&lt;/em&gt;_ = false;&lt;/p&gt;

&lt;p&gt;Because otherwise if a referenced document has the same method &quot;load&quot; it causes error like this&lt;/p&gt;

&lt;p&gt;&quot;Fatal error: Cannot redeclare Proxies\ProjectProxy::load() in /projects/tbi_doctrine/tmp/doctrine/proxies/ProjectProxy.php on line 46&quot;&lt;/p&gt;</description>
                <environment>Cent OS 5.5, PHP 5.3</environment>
            <key id="12369">MODM-118</key>
            <summary>rename &quot;load&quot; method in Proxy object to &quot;__load__&quot;</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vkaplich">Vitaliy Kaplich</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Feb 2011 16:01:01 +0000</created>
                <updated>Fri, 11 Feb 2011 13:33:17 +0000</updated>
                    <resolved>Fri, 11 Feb 2011 13:31:25 +0000</resolved>
                            <version>1.0.0BETA1</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15257" author="jwage" created="Fri, 11 Feb 2011 13:31:25 +0000"  >&lt;p&gt;Fixed for ODM here &lt;a href=&quot;https://github.com/doctrine/mongodb-odm/commit/bfda83d678af1e2104ce4fba62f9dd47185b210e&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/mongodb-odm/commit/bfda83d678af1e2104ce4fba62f9dd47185b210e&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10001">
                <name>Reference</name>
                                                <inwardlinks description="is referenced by">
                            <issuelink>
            <issuekey id="12380">DDC-1029</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-114] wrong method call in Cursor class</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-114</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;i have found a bug in the Cursor class in mongodb-odm:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/doctrine/mongodb-odm/blob/master/lib/Doctrine/ODM/MongoDB/Cursor.php#L85&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/mongodb-odm/blob/master/lib/Doctrine/ODM/MongoDB/Cursor.php#L85&lt;/a&gt; this musst call the current function in the parent class, otherwise mistakes happen when there is a grid fs collection.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12343">MODM-114</key>
            <summary>wrong method call in Cursor class</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="tecbot">Thomas Adam</reporter>
                        <labels>
                    </labels>
                <created>Tue, 1 Feb 2011 16:56:39 +0000</created>
                <updated>Fri, 11 Feb 2011 14:30:12 +0000</updated>
                    <resolved>Fri, 11 Feb 2011 14:30:12 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Mongo, MongoCollection, MongoCursor</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15261" author="jwage" created="Fri, 11 Feb 2011 14:30:12 +0000"  >&lt;p&gt;This is actually already fixed in the github master.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-113] No options for update queries ?</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-113</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;$options are not used for update queries&lt;/p&gt;

&lt;p&gt;=&amp;gt; how can we do an update(&lt;/p&gt;
{&apos;multiple&apos; =&amp;gt; true}
&lt;p&gt;) ?&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt; 
diff -rup doctrine-mongodb-odm-a0667bb/lib/vendor/doctrine-mongodb/lib/Doctrine/MongoDB/Query/Query.php mongodb_odm/lib/vendor/doctrine-mongodb/lib/Doctrine/MongoDB/Query/Query.php
--- doctrine-mongodb-odm-a0667bb/lib/vendor/doctrine-mongodb/lib/Doctrine/MongoDB/Query/Query.php	2011-01-17 06:38:18.000000000 +0100
+++ mongodb_odm/lib/vendor/doctrine-mongodb/lib/Doctrine/MongoDB/Query/Query.php	2011-01-31 17:34:04.000000000 +0100
@@ -172,7 +172,7 @@ class Query implements IteratorAggregate
                 return $this-&amp;gt;collection-&amp;gt;insert($this-&amp;gt;query[&apos;newObj&apos;]);
 
             case self::TYPE_UPDATE:
-                return $this-&amp;gt;collection-&amp;gt;update($this-&amp;gt;query[&apos;query&apos;], $this-&amp;gt;query[&apos;newObj&apos;]);
+                return $this-&amp;gt;collection-&amp;gt;update($this-&amp;gt;query[&apos;query&apos;], $this-&amp;gt;query[&apos;newObj&apos;], $this-&amp;gt;options);
 
             case self::TYPE_REMOVE:
                 return $this-&amp;gt;collection-&amp;gt;remove($this-&amp;gt;query[&apos;query&apos;], $this-&amp;gt;options);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; </description>
                <environment></environment>
            <key id="12338">MODM-113</key>
            <summary>No options for update queries ?</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jfbus">JF Bustarret</reporter>
                        <labels>
                    </labels>
                <created>Mon, 31 Jan 2011 11:48:57 +0000</created>
                <updated>Fri, 11 Feb 2011 14:32:07 +0000</updated>
                    <resolved>Fri, 11 Feb 2011 14:32:07 +0000</resolved>
                            <version>1.0.0BETA2</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15262" author="jwage" created="Fri, 11 Feb 2011 14:31:56 +0000"  >&lt;p&gt;Fixed here &lt;a href=&quot;https://github.com/doctrine/mongodb/commit/9511df1cede93286e8ddaa5dd00c73236fee08bd&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/mongodb/commit/9511df1cede93286e8ddaa5dd00c73236fee08bd&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-112] [PATCH] Allow Hydrator classes to be regenerated only if they are absent</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-112</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Hydrator classes are either never generated ou regenerated on each request.&lt;/p&gt;

&lt;p&gt;The patch add another case : regenerate only if absent.&lt;/p&gt;

&lt;p&gt;HydratorFactory::$autoGenerate switches to int and can have 3 values : HydratorFactory::AUTOGENERATE_NEVER, HydratorFactory::AUTOGENERATE_ALWAYS or HydratorFactory::AUTOGENERATE_ABSENT&lt;/p&gt;</description>
                <environment></environment>
            <key id="12336">MODM-112</key>
            <summary>[PATCH] Allow Hydrator classes to be regenerated only if they are absent</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="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jfbus">JF Bustarret</reporter>
                        <labels>
                    </labels>
                <created>Mon, 31 Jan 2011 03:44:29 +0000</created>
                <updated>Fri, 11 Feb 2011 14:52:32 +0000</updated>
                    <resolved>Fri, 11 Feb 2011 14:52:32 +0000</resolved>
                            <version>1.0.0BETA2</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Hydration</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15199" author="jwage" created="Mon, 31 Jan 2011 11:50:30 +0000"  >&lt;p&gt;Hi, I don&apos;t think this is quite right. We should make this feature match the way proxies are generated. We will need to add a console command to generate the proxies for production.&lt;/p&gt;</comment>
                    <comment id="15204" author="jfbus" created="Wed, 2 Feb 2011 04:38:42 +0000"  >&lt;p&gt;A console command would need to know the configuration of the factories... It can&apos;t be a standalone script.&lt;/p&gt;

&lt;p&gt;A symfony script would be great (provided it works with symfony &amp;lt; 2), but what about non symfony users ?&lt;/p&gt;

&lt;p&gt;I added Proxies to my patch, and switched the two const to the Configuration class.&lt;/p&gt;</comment>
                    <comment id="15205" author="jfbus" created="Wed, 2 Feb 2011 04:40:26 +0000"  >&lt;p&gt;Updated patch with proxies&lt;/p&gt;</comment>
                    <comment id="15263" author="jwage" created="Fri, 11 Feb 2011 14:52:32 +0000"  >&lt;p&gt;Hi, I added the console commands for generating proxy and hydrator clases here &lt;a href=&quot;https://github.com/doctrine/mongodb-odm/commit/56fc267459dd0b972e710b0ff1cab5fbf1859fd9&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/mongodb-odm/commit/56fc267459dd0b972e710b0ff1cab5fbf1859fd9&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will be integrated with DoctrineMongoDBBundle soon.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10925" name="autogenerate.patch" size="6557" author="jfbus" created="Wed, 2 Feb 2011 04:40:26 +0000" />
                    <attachment id="10923" name="autogenerate.patch" size="3170" author="jfbus" created="Mon, 31 Jan 2011 03:44:29 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-111] Trouble with MappedSuperclass/Single collection inheritance and commit 2e8071a4dc68b027f969</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-111</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;I have the following classes :&lt;/p&gt;

&lt;p&gt;@MappedSuperClass&lt;br/&gt;
@InheritanceType(&quot;SINGLE_COLLECTION&quot;)&lt;br/&gt;
@DiscriminatorField(fieldName=&quot;_class&quot;)&lt;br/&gt;
@DiscriminatorMap(&lt;/p&gt;
{&quot;SuperClass&quot;=&quot;SuperClass&quot;, &quot;SubClass1&quot;=&quot;SubClass1&quot;, &quot;SubClass2&quot;=&quot;SubClass2&quot;}
&lt;p&gt;)&lt;br/&gt;
abstract class SuperClass {}&lt;/p&gt;

&lt;p&gt;@Document&lt;br/&gt;
class SubClass1 extends SuperClass {}&lt;/p&gt;

&lt;p&gt;@MappedSuperClass&lt;br/&gt;
abstract class SuperClass2 extends SuperClass {}&lt;/p&gt;

&lt;p&gt;@Document&lt;br/&gt;
abstract class SubClass2 extends SuperClass2 {}&lt;/p&gt;

&lt;p&gt;SubClass2 does not use the single collection.&lt;br/&gt;
SubClass1 and SubClass2 do not use the discriminator map.&lt;/p&gt;

&lt;p&gt;This broke after commit 2e8071a4dc68b027f969.&lt;/p&gt;

&lt;p&gt;Why can&apos;t we use MappedSuperclasses in an single collection inheritance strategy ?&lt;/p&gt;
</description>
                <environment></environment>
            <key id="12333">MODM-111</key>
            <summary>Trouble with MappedSuperclass/Single collection inheritance and commit 2e8071a4dc68b027f969</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jfbus">JF Bustarret</reporter>
                        <labels>
                    </labels>
                <created>Fri, 28 Jan 2011 10:10:04 +0000</created>
                <updated>Fri, 11 Feb 2011 14:55:30 +0000</updated>
                    <resolved>Fri, 11 Feb 2011 14:55:30 +0000</resolved>
                            <version>1.0.0BETA2</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15197" author="jfbus" created="Mon, 31 Jan 2011 03:47:29 +0000"  >&lt;p&gt;Dropped MappedSuperClasses and switched to Document classes.&lt;/p&gt;

&lt;p&gt;I&apos;m not very happy to have abstract classes configured as Document, but it works.&lt;/p&gt;</comment>
                    <comment id="15264" author="jwage" created="Fri, 11 Feb 2011 14:53:13 +0000"  >&lt;p&gt;Hi, can you make a test case for this exposing the problem?&lt;/p&gt;</comment>
                    <comment id="15265" author="jwage" created="Fri, 11 Feb 2011 14:55:30 +0000"  >&lt;p&gt;Ok, a mapped super class is not the top of the inheritance hierarchy. The first class that extends the mapped super class is where you would define that inheritance information.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-110] QueryBuilder missing values and values with wrong data types being inserted</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-110</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;I&apos;m using annotation mapping for my documents and found something strange when i insert a document (having an embed document) using the query builder...&lt;/p&gt;

&lt;p&gt;When i use the document class and persist it, things are fine:&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;$testCase = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Documents\Test();
$testCase-&amp;gt;testInt = &apos;0&apos;;
$testCase-&amp;gt;intfields = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Documents\Embed\Intfields();
$testCase-&amp;gt;intfields-&amp;gt;intone = &apos;1&apos;;
$testCase-&amp;gt;intfields-&amp;gt;inttwo = &apos;2&apos;;
$dm-&amp;gt;persist($testCase);
$dm-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Result:&lt;br/&gt;
{&lt;br/&gt;
   &quot;_id&quot;: ObjectId(&quot;4d417fb1723014d009000008&quot;),&lt;br/&gt;
   &quot;testInt&quot;: 0,&lt;br/&gt;
   &quot;intfields&quot;: &lt;/p&gt;
{
     &quot;intone&quot;: 1,
     &quot;inttwo&quot;: 2
  }
&lt;p&gt;} &lt;/p&gt;

&lt;p&gt;But when i use the query builder:&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;$dm-&amp;gt;createQueryBuilder()
-&amp;gt;insert(&apos;Documents\Test&apos;)
-&amp;gt;field(&apos;testInt&apos;)-&amp;gt;set(&apos;0&apos;)
-&amp;gt;field(&apos;intfields.intone&apos;)-&amp;gt;set(&apos;1&apos;)
-&amp;gt;field(&apos;intfields.inttwo&apos;)-&amp;gt;set(&apos;2&apos;)
-&amp;gt;getQuery()-&amp;gt;execute();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Result:&lt;br/&gt;
{&lt;br/&gt;
   &quot;_id&quot;: ObjectId(&quot;4d417fb1723014d009000009&quot;),&lt;br/&gt;
   &quot;testInt&quot;: &quot;0&quot;,&lt;br/&gt;
   &quot;intfields&quot;: &lt;/p&gt;
{
     &quot;inttwo&quot;: &quot;2&quot;
  }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Intone is missing and the values are all string values.&lt;/p&gt;

&lt;p&gt;It seems to be a bug, but as i&apos;m new to the doctrine and mongo world, it&apos;s more than possible to be a user error. :}&lt;/p&gt;

&lt;p&gt;I was using the clone version of the master git hub.. is that beta2?&lt;/p&gt;

&lt;p&gt;Regards&lt;br/&gt;
S.&lt;/p&gt;

&lt;p&gt;PS.: Php files are attached&lt;/p&gt;</description>
                <environment></environment>
            <key id="12331">MODM-110</key>
            <summary>QueryBuilder missing values and values with wrong data types being inserted</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="shards">Shards</reporter>
                        <labels>
                    </labels>
                <created>Thu, 27 Jan 2011 10:11:13 +0000</created>
                <updated>Sat, 19 Feb 2011 18:28:25 +0000</updated>
                    <resolved>Sat, 12 Feb 2011 23:54:43 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15266" author="jwage" created="Fri, 11 Feb 2011 14:58:48 +0000"  >&lt;p&gt;Hi, phpunit test case?&lt;/p&gt;</comment>
                    <comment id="15290" author="jwage" created="Sat, 12 Feb 2011 23:54:43 +0000"  >&lt;p&gt;This is fixed now.&lt;/p&gt;</comment>
                    <comment id="15302" author="shards" created="Mon, 14 Feb 2011 03:28:13 +0000"  >&lt;p&gt;thank you =}&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10921" name="Documents.zip" size="1079" author="shards" created="Thu, 27 Jan 2011 10:11:13 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-107] Document Manager does not delete References</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-107</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;References are not deleted when the function $dm-&amp;gt;remove($x) is called.&lt;br/&gt;
It deltes $x from the database but all references are still persisted.&lt;/p&gt;

&lt;p&gt;See function: testManyDeleteReference() in attached file. &lt;/p&gt;</description>
                <environment>Ubuntu Linux 10.04 Maveric PHP 5.3.3</environment>
            <key id="12296">MODM-107</key>
            <summary>Document Manager does not delete References</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="exeu">Jan Eichhorn</reporter>
                        <labels>
                    </labels>
                <created>Thu, 13 Jan 2011 12:04:36 +0000</created>
                <updated>Fri, 11 Feb 2011 15:38:41 +0000</updated>
                    <resolved>Fri, 11 Feb 2011 15:38:41 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15188" author="exeu" created="Wed, 26 Jan 2011 03:06:50 +0000"  >&lt;p&gt;I don&apos;t know why Billy Bob has deleted the description?&lt;br/&gt;
So i&apos;ve restored it ....&lt;br/&gt;
Please don&apos;t do this without leaving a comment why!&lt;/p&gt;</comment>
                    <comment id="15268" author="jwage" created="Fri, 11 Feb 2011 15:38:41 +0000"  >&lt;p&gt;This is fixed here &lt;a href=&quot;https://github.com/doctrine/mongodb-odm/commit/1791da1a406d67dc32fcb72cc200ccd2cd6cb828&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/mongodb-odm/commit/1791da1a406d67dc32fcb72cc200ccd2cd6cb828&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for the issue report!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10908" name="ReferencesTest.php" size="5553" author="exeu" created="Thu, 13 Jan 2011 12:04:36 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-106] $in fails on document identifiers</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-106</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;If I try to select a couple of documents with the in() query, I receive an empty result set when the selected field is the document id.&lt;/p&gt;

&lt;p&gt;The following code works fine and selects the right document:&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;       $query = $dm-&amp;gt;createQueryBuilder(&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;\Does\Not\Matter&quot;&lt;/span&gt;)
                   -&amp;gt;field(&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)-&amp;gt;equals(&lt;span class=&quot;code-quote&quot;&gt;&quot;4d1db8ba2d8aa162300a0000&quot;&lt;/span&gt;)
                   -&amp;gt;getQuery()-&amp;gt;execute();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Whereas the following query returns nothing:&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;       $query = $dm-&amp;gt;createQueryBuilder(&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;\Does\Not\Matter&quot;&lt;/span&gt;)
                   -&amp;gt;field(&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)-&amp;gt;in(array(&lt;span class=&quot;code-quote&quot;&gt;&quot;4d1db8ba2d8aa162300a0000&quot;&lt;/span&gt;))
                   -&amp;gt;getQuery()-&amp;gt;execute();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12286">MODM-106</key>
            <summary>$in fails on document identifiers</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="garbage">Andreas Schmidt</reporter>
                        <labels>
                    </labels>
                <created>Sat, 8 Jan 2011 09:40:19 +0000</created>
                <updated>Fri, 11 Feb 2011 15:53:18 +0000</updated>
                    <resolved>Fri, 11 Feb 2011 15:53:18 +0000</resolved>
                            <version>1.0.0BETA1</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Document Manager</component>
                <component>Document Repositories</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15129" author="jwage" created="Wed, 12 Jan 2011 21:38:33 +0000"  >&lt;p&gt;This should be fixed in the latest version in github. I resolved the issues with converting the different types of query parameters&lt;/p&gt;</comment>
                    <comment id="15206" author="vladar" created="Wed, 2 Feb 2011 08:40:08 +0000"  >&lt;p&gt;This is not fixed actually, as there is other issue in DocumentPersister::prepareQueryValue method, unrelated to type converting.&lt;/p&gt;

&lt;p&gt;e.g. following call will produce unexpectable result:&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;$result = $persister-&amp;gt;prepareQueryValue(&apos;_id&apos;, array(&apos;$in&apos; =&amp;gt; array(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \MongoId(&apos;some_id&apos;))));
&lt;span class=&quot;code-comment&quot;&gt;// will produce &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \MongoId() instead of original array&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That&apos;s because prepareQueryValue always transforms value for &apos;_id&apos; field to scalar, even if it was originally array, containing $in.&lt;/p&gt;</comment>
                    <comment id="15269" author="jwage" created="Fri, 11 Feb 2011 15:53:18 +0000"  >&lt;p&gt;I see better now. I fixed it here &lt;a href=&quot;https://github.com/doctrine/mongodb-odm/commit/199cab760a7b3cc6a5050111c25e47d4788b310f&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/mongodb-odm/commit/199cab760a7b3cc6a5050111c25e47d4788b310f&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-101] Following documentation still does not produce a working bootstrap.</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-101</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Setting up following the documentation found at &lt;a href=&quot;http://www.doctrine-project.org/projects/mongodb_odm/1.0/docs/reference/introduction/en#introduction&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/mongodb_odm/1.0/docs/reference/introduction/en#introduction&lt;/a&gt; produces the following errors.&lt;/p&gt;

&lt;p&gt;PHP Fatal error:  Class &apos;Doctrine\MongoDB\Configuration&apos; not found in C:\Inetpub\sites\phpdev\public\mongodb_odm\lib\Doctrine\ODM\MongoDB\Configuration.php on line 43&lt;br/&gt;
PHP Stack trace:&lt;br/&gt;
PHP   1. &lt;/p&gt;
{main}
&lt;p&gt;() C:\Inetpub\sites\phpdev\public\index.php:0&lt;br/&gt;
PHP   2. Doctrine\Common\ClassLoader-&amp;gt;loadClass() C:\Inetpub\sites\phpdev\public\mongodb_odm\lib\vendor\doctrine-common\lib\Doctrine\Common\ClassLoader.php:0&lt;br/&gt;
PHP   3. require() C:\Inetpub\sites\phpdev\public\mongodb_odm\lib\vendor\doctrine-common\lib\Doctrine\Common\ClassLoader.php:148&lt;/p&gt;

&lt;p&gt;Is there something missing from the documentation?&lt;/p&gt;</description>
                <environment>Windows Server 2003, IIS6, PHP 5.3.4</environment>
            <key id="12222">MODM-101</key>
            <summary>Following documentation still does not produce a working bootstrap.</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="thorpe">Tony R Quilkey</reporter>
                        <labels>
                    </labels>
                <created>Sun, 12 Dec 2010 18:17:08 +0000</created>
                <updated>Sat, 19 Feb 2011 18:25:12 +0000</updated>
                    <resolved>Sat, 19 Feb 2011 18:25:12 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14988" author="jwage" created="Mon, 20 Dec 2010 16:11:19 +0000"  >&lt;p&gt;Yes, the documentation is not up to date with the latest version in git. The ODM depends on this now &lt;a href=&quot;https://github.com/doctrine/mongodb&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/mongodb&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="15345" author="jwage" created="Sat, 19 Feb 2011 18:25:12 +0000"  >&lt;p&gt;The docs are updated now!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-100] XmlDriver and &quot;discriminatorMap&quot; for &quot;EmbedMany&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-100</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Please correct me if i&apos;m wrong but it looks like that current implementation of XmlDriver does not support the following feature:&lt;/p&gt;

&lt;p&gt;&quot;discriminatorMap&quot; for &quot;EmbedMany&quot;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/projects/mongodb_odm/1.0/docs/reference/embedded-mapping/en#mixing-document-types&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/mongodb_odm/1.0/docs/reference/embedded-mapping/en#mixing-document-types&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;?php&lt;/p&gt;

&lt;p&gt;class User&lt;br/&gt;
{&lt;br/&gt;
    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@EmbedMany(&lt;/li&gt;
	&lt;li&gt;discriminatorMap=
{
     *     &quot;download&quot;=&quot;DownloadTask&quot;,
     *     &quot;build&quot;=&quot;BuildTask&quot;
     *   }&lt;/li&gt;
	&lt;li&gt;)&lt;br/&gt;
     */&lt;br/&gt;
    private $tasks = array();&lt;br/&gt;
}&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This feature is very important for our project and without it looks like that we have to move to Docblock annotations instead of XML format which could be rather painful and time consuming.&lt;/p&gt;
</description>
                <environment>CentOS 5.5 PHP 5.3.3</environment>
            <key id="12213">MODM-100</key>
            <summary>XmlDriver and &quot;discriminatorMap&quot; for &quot;EmbedMany&quot;</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</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="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vkaplich">Vitaliy Kaplich</reporter>
                        <labels>
                    </labels>
                <created>Thu, 9 Dec 2010 15:01:10 +0000</created>
                <updated>Mon, 20 Dec 2010 16:06:02 +0000</updated>
                    <resolved>Mon, 20 Dec 2010 16:06:02 +0000</resolved>
                            <version>1.0.0BETA1</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14973" author="jwage" created="Wed, 15 Dec 2010 16:11:51 +0000"  >&lt;p&gt;It looks like it is just missing. I&apos;d be happy to accept a patch if you can provide one &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.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;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-99] ODM tests drop all collections from all databases on the MongoDB server</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-99</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Recently I run ODM tests in my sandbox and found out that all collections in all databases were dropped after that.&lt;br/&gt;
Thanks god I did run it in my sandbox only which has own database instance.&lt;/p&gt;

&lt;p&gt;After reviewing the code I found out that Doctrine\ODM\MongoDB\Tests\BaseTest-&amp;gt;tearDown() method cleans up the whole MongoDB server after running the tests.&lt;/p&gt;

&lt;p&gt;From one hand such &lt;b&gt;extremely unsafe&lt;/b&gt; behavior is not mentioned anywhere from another hand there are no ways to work around it currently but only changing the tests code.&lt;/p&gt;

&lt;p&gt;It would be really great if there is a way to specify MongoDB connection parameters for ODM tests or at least change tests code in order to drop only databases which were created during the test&lt;br/&gt;
and no others else.&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;</description>
                <environment>Cent OS 5.5, PHP 5.3.3</environment>
            <key id="12206">MODM-99</key>
            <summary>ODM tests drop all collections from all databases on the MongoDB server</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vkaplich">Vitaliy Kaplich</reporter>
                        <labels>
                    </labels>
                <created>Wed, 8 Dec 2010 13:26:40 +0000</created>
                <updated>Mon, 20 Dec 2010 16:40:33 +0000</updated>
                    <resolved>Mon, 20 Dec 2010 16:40:33 +0000</resolved>
                            <version>1.0.0BETA1</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-97] FindAndModify does not return an object</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-97</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Boolean true is returned instead of an object after a FindAndModify command is successfully executed.&lt;/p&gt;

&lt;p&gt;		 $c = $dm-&amp;gt;createQuery(&apos;downloads&apos;)&lt;br/&gt;
				  -&amp;gt;findAndModify(array(&apos;new&apos; =&amp;gt; true))&lt;br/&gt;
				  &lt;del&gt;&amp;gt;field(&apos;key&apos;)&lt;/del&gt;&amp;gt;equals(&apos;file1&apos;)&lt;br/&gt;
				  -&amp;gt;update()&lt;br/&gt;
				  &lt;del&gt;&amp;gt;field(&apos;counter&apos;)&lt;/del&gt;&amp;gt;inc(1)&lt;br/&gt;
				  -&amp;gt;execute();&lt;/p&gt;

&lt;p&gt;                 echo gettype($c); // boolean&lt;/p&gt;</description>
                <environment>Windows xp sp3, apache</environment>
            <key id="12192">MODM-97</key>
            <summary>FindAndModify does not return an object</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="bsrykt">Ba&#351;ar Aykut</reporter>
                        <labels>
                    </labels>
                <created>Sat, 4 Dec 2010 20:10:24 +0000</created>
                <updated>Mon, 20 Dec 2010 16:50:34 +0000</updated>
                    <resolved>Mon, 20 Dec 2010 16:50:34 +0000</resolved>
                            <version>1.0.0BETA1</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Document Manager</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14911" author="jwage" created="Sun, 5 Dec 2010 20:23:22 +0000"  >&lt;p&gt;The syntax using the latest version of mongodb odm in git is:&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;$c = $dm-&amp;gt;createQuery(&apos;downloads&apos;)
-&amp;gt;findAndUpdate()
-&amp;gt;returnNew()
-&amp;gt;field(&apos;key&apos;)-&amp;gt;equals(&apos;file1&apos;)
-&amp;gt;field(&apos;counter&apos;)&amp;gt;inc(1)
-&amp;gt;execute();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14915" author="bsrykt" created="Mon, 6 Dec 2010 07:06:47 +0000"  >&lt;p&gt;findAndUpdate does not return an object also however it returns an array which includes the object. Is it an expected behavior? And it does not update the record?&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;array(1) {
  [&lt;span class=&quot;code-quote&quot;&gt;&quot;4cf9163aff2e00000000154e&quot;&lt;/span&gt;]=&amp;gt;
  object(downloads)#125 (3) {
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;]=&amp;gt;string(24) &lt;span class=&quot;code-quote&quot;&gt;&quot;4cf9163aff2e00000000154e&quot;&lt;/span&gt;
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;key&quot;&lt;/span&gt;] =&amp;gt; string(6) &lt;span class=&quot;code-quote&quot;&gt;&quot;file1&quot;&lt;/span&gt;
    [&lt;span class=&quot;code-quote&quot;&gt;&quot;counter&quot;&lt;/span&gt;] =&amp;gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(10391)
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14922" author="jwage" created="Mon, 6 Dec 2010 13:19:47 +0000"  >&lt;p&gt;Are you using the latest version of everything?&lt;/p&gt;</comment>
                    <comment id="14925" author="bsrykt" created="Tue, 7 Dec 2010 08:55:28 +0000"  >&lt;p&gt;I have updated to the latest version in the git. Below query works and returns the updated object as expected. However this is true only for the first call. Repeated calls return the first object .&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;		$pid = $dm-&amp;gt;createQueryBuilder(&apos;downloads&apos;)
				  -&amp;gt;findAndUpdate()
				  -&amp;gt;returnNew(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
				  -&amp;gt;field(&apos;key&apos;)-&amp;gt;equals(&apos;file1&apos;)
				  -&amp;gt;field(&apos;counter&apos;)-&amp;gt;inc(1)
				  -&amp;gt;getQuery()-&amp;gt;execute();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14927" author="jwage" created="Tue, 7 Dec 2010 13:29:19 +0000"  >&lt;p&gt;Hi, I don&apos;t follow. Can you show a test of what you are doing? I did a simple test executing a findAndUpdate 2 times in a row and it worked.&lt;/p&gt;</comment>
                    <comment id="14928" author="bsrykt" created="Tue, 7 Dec 2010 15:37:06 +0000"  >&lt;p&gt;It works but it doesn&apos;t return the updated object on subsequent calls. &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;$pid = $dm-&amp;gt;createQueryBuilder(&apos;downloads&apos;)
				  -&amp;gt;findAndUpdate()
				  -&amp;gt;returnNew(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
				  -&amp;gt;field(&apos;key&apos;)-&amp;gt;equals(&apos;file1&apos;)
				  -&amp;gt;field(&apos;counter&apos;)-&amp;gt;inc(1)
				  -&amp;gt;getQuery()-&amp;gt;execute();

var_dump($pid);

$pid = $dm-&amp;gt;createQueryBuilder(&apos;downloads&apos;)
				  -&amp;gt;findAndUpdate()
				  -&amp;gt;returnNew(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
				  -&amp;gt;field(&apos;key&apos;)-&amp;gt;equals(&apos;file1&apos;)
				  -&amp;gt;field(&apos;counter&apos;)-&amp;gt;inc(1)
				  -&amp;gt;getQuery()-&amp;gt;execute();

var_dump($pid);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Outputs&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;object(downloads)#112 (3) {
  [&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;]=&amp;gt;
  string(24) &lt;span class=&quot;code-quote&quot;&gt;&quot;4cfadede55242b0084000003&quot;&lt;/span&gt;
  [&lt;span class=&quot;code-quote&quot;&gt;&quot;key&quot;&lt;/span&gt;]=&amp;gt;
  string(6) &lt;span class=&quot;code-quote&quot;&gt;&quot;file1&quot;&lt;/span&gt;
  [&lt;span class=&quot;code-quote&quot;&gt;&quot;counter&quot;&lt;/span&gt;]=&amp;gt;
  &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(1)
}

object(downloads)#112 (3) {
  [&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;]=&amp;gt;
  string(24) &lt;span class=&quot;code-quote&quot;&gt;&quot;4cfadede55242b0084000003&quot;&lt;/span&gt;
  [&lt;span class=&quot;code-quote&quot;&gt;&quot;key&quot;&lt;/span&gt;]=&amp;gt;
  string(6) &lt;span class=&quot;code-quote&quot;&gt;&quot;file1&quot;&lt;/span&gt;
  [&lt;span class=&quot;code-quote&quot;&gt;&quot;counter&quot;&lt;/span&gt;]=&amp;gt;
  &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(1)
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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-comment&quot;&gt;// document at the beginning
&lt;/span&gt;{ &lt;span class=&quot;code-quote&quot;&gt;&quot;_id&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;4cfadede55242b0084000003&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;key&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;file1&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;counter&quot;&lt;/span&gt;: 0 }

&lt;span class=&quot;code-comment&quot;&gt;// after the calls
&lt;/span&gt;{ &lt;span class=&quot;code-quote&quot;&gt;&quot;_id&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;4cfadede55242b0084000003&quot;&lt;/span&gt;,&lt;span class=&quot;code-quote&quot;&gt;&quot;key&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;file1&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;counter&quot;&lt;/span&gt;: 2 }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14929" author="jwage" created="Tue, 7 Dec 2010 20:27:45 +0000"  >&lt;p&gt;Since Doctrine maintains an identity map, the 2nd time it is not refreshing the documents data. Since it already exists in the identity map it simply returns that document. You can tell Doctrine to refresh the data by doing this:&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;$pid = $dm-&amp;gt;createQueryBuilder(&apos;downloads&apos;)
    -&amp;gt;findAndUpdate()
    -&amp;gt;returnNew(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
    -&amp;gt;refresh(&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
    -&amp;gt;field(&apos;key&apos;)-&amp;gt;equals(&apos;file1&apos;)
    -&amp;gt;field(&apos;counter&apos;)-&amp;gt;inc(1)
    -&amp;gt;getQuery()-&amp;gt;execute();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14939" author="bsrykt" created="Thu, 9 Dec 2010 10:28:08 +0000"  >&lt;p&gt;I don&apos;t see any function called refresh? Are you going to add it? I think it would be better to return refreshed data automatically for the findAndUpdate command.&lt;/p&gt;</comment>
                    <comment id="14964" author="jwage" created="Mon, 13 Dec 2010 08:06:48 +0000"  >&lt;p&gt;I added it already to the latest version in git.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-95] Persisting a document that had embedded documents prior to being removed results in a document with no embedded documents</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-95</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;1) Persist a document with embedded documents&lt;br/&gt;
2) Load document into memory (store in variable)&lt;br/&gt;
3) Remove document using ODM&lt;br/&gt;
4) Persist loaded document back to DB using ODM&lt;br/&gt;
5) Embedded documents are now gone&lt;/p&gt;

&lt;p&gt;I have created a new failing test in the ODM and requested a pull&lt;/p&gt;</description>
                <environment></environment>
            <key id="12146">MODM-95</key>
            <summary>Persisting a document that had embedded documents prior to being removed results in a document with no embedded documents</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jseverson">Jay Severson</reporter>
                        <labels>
                    </labels>
                <created>Wed, 24 Nov 2010 06:29:05 +0000</created>
                <updated>Wed, 24 Nov 2010 13:02:52 +0000</updated>
                    <resolved>Wed, 24 Nov 2010 13:02:52 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14809" author="jwage" created="Wed, 24 Nov 2010 13:02:52 +0000"  >&lt;p&gt;Thanks! Fixed in master.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-94] $or operator</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-94</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;MongoDB proposes an operator $or&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24or&quot; class=&quot;external-link&quot;&gt;http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24or&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;Can you add this feature in Doctrine\ODM\MongoDB\Query&lt;/p&gt;

&lt;p&gt;Thank you&lt;/p&gt;

&lt;p&gt;Julien&lt;/p&gt;</description>
                <environment></environment>
            <key id="12034">MODM-94</key>
            <summary>$or operator</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="julienj">Julien</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 Oct 2010 13:35:08 +0000</created>
                <updated>Mon, 15 Nov 2010 12:11:57 +0000</updated>
                    <resolved>Mon, 15 Nov 2010 12:11:57 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14654" author="kriswallsmith" created="Mon, 1 Nov 2010 09:33:21 +0000"  >&lt;p&gt;I&apos;ve proposed a resolution in the &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/MODM-94&quot; title=&quot;$or operator&quot;&gt;&lt;del&gt;MODM-94&lt;/del&gt;&lt;/a&gt; branch on GitHub, what do you think?&lt;br/&gt;
&lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/428c4f3ee2b9600ad83bbe8749ebc56224ad75aa&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/428c4f3ee2b9600ad83bbe8749ebc56224ad75aa&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14668" author="kriswallsmith" created="Fri, 5 Nov 2010 07:41:14 +0000"  >&lt;p&gt;I don&apos;t seem to have permission to close this ticket...&lt;/p&gt;

&lt;p&gt;I merged this change into master.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-93] YAML and XML mapping drivers ignore discriminatorField and discriminatorMap</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-93</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;The discriminatorField and discriminatorMap options are ignored by both the YAML and XML drivers.&lt;/p&gt;

&lt;p&gt;Example:&lt;br/&gt;
This mapping fails to store the discriminator in the type field and instead uses _doctrine_class_name as the discriminatorField the mapping also reverts to using class names.&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-xml&quot;&gt; 
&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;?xml version=&lt;span class=&quot;code-quote&quot;&gt;&quot;1.0&quot;&lt;/span&gt; encoding=&lt;span class=&quot;code-quote&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;?&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;doctrine-mongo-mapping&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-tag&quot;&gt;&amp;lt;document name=&lt;span class=&quot;code-quote&quot;&gt;&quot;Application\Test\Document\Group&quot;&lt;/span&gt; collection=&lt;span class=&quot;code-quote&quot;&gt;&quot;groups&quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;code-tag&quot;&gt;&amp;lt;field name=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt; fieldName=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt; id=&lt;span class=&quot;code-quote&quot;&gt;&quot;true&quot;&lt;/span&gt; /&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;code-tag&quot;&gt;&amp;lt;field name=&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt; fieldName=&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt; type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt; /&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;code-tag&quot;&gt;&amp;lt;embed-many field=&lt;span class=&quot;code-quote&quot;&gt;&quot;people&quot;&lt;/span&gt; discriminator-field=&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;code-tag&quot;&gt;&amp;lt;discriminator-map&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;code-tag&quot;&gt;&amp;lt;discriminator-mapping class=&lt;span class=&quot;code-quote&quot;&gt;&quot;Admin&quot;&lt;/span&gt; value=&lt;span class=&quot;code-quote&quot;&gt;&quot;Admin&quot;&lt;/span&gt; /&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;code-tag&quot;&gt;&amp;lt;discriminator-mapping class=&lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt; value=&lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt; /&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/discriminator-map&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/embed-many&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/document&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-tag&quot;&gt;&amp;lt;/doctrine-mongo-mapping&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I think that this is also a problem for referenced documents as well, as the code for the two is nearly identical.&lt;/p&gt;

&lt;p&gt;I refactored addEmbedMapping and addReferenceMapping to call the same function addDocumentMapping&lt;br/&gt;
Commit can be found here &lt;a href=&quot;http://github.com/dordille/mongodb-odm/commit/41ce2ee126ff7f82610130704dbec451384bfdd3&quot; class=&quot;external-link&quot;&gt;http://github.com/dordille/mongodb-odm/commit/41ce2ee126ff7f82610130704dbec451384bfdd3&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Symony2&lt;br/&gt;
Doctrine2 latest from github</environment>
            <key id="12030">MODM-93</key>
            <summary>YAML and XML mapping drivers ignore discriminatorField and discriminatorMap</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="dordille">Dan Ordille</reporter>
                        <labels>
                    </labels>
                <created>Sun, 24 Oct 2010 02:53:38 +0000</created>
                <updated>Wed, 24 Nov 2010 13:13:32 +0000</updated>
                    <resolved>Wed, 24 Nov 2010 13:13:32 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                <version>1.0.0ALPHA2</version>
                <version>1.0.0BETA1</version>
                <version>1.0.0BETA2</version>
                                <fixVersion>1.0.0ALPHA1</fixVersion>
                <fixVersion>1.0.0ALPHA2</fixVersion>
                <fixVersion>1.0.0BETA1</fixVersion>
                <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14811" author="jwage" created="Wed, 24 Nov 2010 13:13:32 +0000"  >&lt;p&gt;Merged! Thanks for the fix!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-92] Changing all data in embedMany collections can create duplicate embedded objects</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-92</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Repeatable in the following use case, when the default pushPull strategy is used for an embedMany collection:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Persist an object with a single embedded object in its embedMany collection.  Flush/clear/refetch.&lt;/li&gt;
	&lt;li&gt;Clear the collection and add a new embedded object.  Flush/clear/refetch.&lt;/li&gt;
	&lt;li&gt;The containing object&apos;s collection now has two copies of the replacement object from the previous step.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I investigated this as best I could, and traced the problem to BasicDocumentPersister::prepareUpdateData() and the data it receives from UnitOfWork&apos;s changeset.&lt;/p&gt;

&lt;p&gt;The UoW changeset simply reports the old/new embedded collections as arrays of raw data.  This makes BasicDocumentPersister unable to distinguish whether a $set or $pullAll/$pushAll is an appropriate course of action, since it cannot discern whether the embedded objects are actually different (by SPL object hash) or merely changed.  Following the logic in prepareUpdateData(), we end up doing two things when processing the update for the collection field:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Since old !== new, and we&apos;re a collection field type, generate pull/push commands based on the delete/insert diffs.&lt;/li&gt;
	&lt;li&gt;Since we&apos;re embedded and new evalutes to true, recursively call prepareUpdateData() on ourself, which will then go on to generate set commands.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This chain of commands will then reach BasicDocumentPersister::update() later on and given the logic check within:&lt;/p&gt;

&lt;p&gt;&amp;gt; if ((isset($update&lt;span class=&quot;error&quot;&gt;&amp;#91;$this-&amp;gt;cmd . &amp;#39;pushAll&amp;#39;&amp;#93;&lt;/span&gt;) || isset($update&lt;span class=&quot;error&quot;&gt;&amp;#91;$this-&amp;gt;cmd . &amp;#39;pullAll&amp;#39;&amp;#93;&lt;/span&gt;)) &amp;amp;&amp;amp; isset($update&lt;span class=&quot;error&quot;&gt;&amp;#91;$this-&amp;gt;cmd . &amp;#39;set&amp;#39;&amp;#93;&lt;/span&gt;)) ...&lt;/p&gt;

&lt;p&gt;The $set command will be executed first, followed by $pullAll/$pushAll later.  This $set actually changes the very data that $pullAll expects to remove, so $pullAll will do nothing but $pushAll will still insert a copy of our new data.  The end result is that we now have two copies of our new data in the collection.&lt;/p&gt;</description>
                <environment>MongoDB 1.6.3, with Mongo ODM master as of 10/22/2010</environment>
            <key id="12028">MODM-92</key>
            <summary>Changing all data in embedMany collections can create duplicate embedded objects</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jmikola">Jeremy Mikola</reporter>
                        <labels>
                    </labels>
                <created>Fri, 22 Oct 2010 15:55:34 +0000</created>
                <updated>Tue, 23 Nov 2010 16:20:55 +0000</updated>
                    <resolved>Tue, 23 Nov 2010 16:20:55 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Persister</component>
                <component>UnitOfWork</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14595" author="jmikola" created="Fri, 22 Oct 2010 16:05:46 +0000"  >&lt;p&gt;Failing test case here: &lt;a href=&quot;http://github.com/jmikola/mongodb-odm/commit/336a700ac6fe0cdf013fc864d8e70f43cb5b73e2&quot; class=&quot;external-link&quot;&gt;http://github.com/jmikola/mongodb-odm/commit/336a700ac6fe0cdf013fc864d8e70f43cb5b73e2&lt;/a&gt;&lt;br/&gt;
Pull request here: &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/pull/37&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/pull/37&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Temporary fix is to switch the mapping strategy to &quot;set&quot; instead of the default &quot;pushPull&quot;&lt;/p&gt;

&lt;p&gt;I spoke with Bulat and believe the long-term fix for this will be having UoW preserve the SPL object hash of embedded objects in changsets, so that we can compare something more than arrays when deciding what MongoDB commands to utilize.  For cases such as this, the $set is superfluous in my opinion - it should only be used if the same object remained in the collection and had its value(s) changed.&lt;/p&gt;</comment>
                    <comment id="14804" author="jwage" created="Tue, 23 Nov 2010 16:20:55 +0000"  >&lt;p&gt;Thanks! This is now fixed with the refactoring we did the persisters last week!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-91] Document unnecessarily persisted when embedded documents have null properties</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-91</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;The setup is a document that has an embedded document. If the embedded document is persisted with at least one field set to null, the changeset for the parent document will include the embedded document, even if no changes have been made.&lt;/p&gt;

&lt;p&gt;The reason is that the &quot;$orgValue&quot; in UnitOfWork::computeChangeSet() won&apos;t contain the null field at all, while the &quot;$actualValue&quot; contains the field properly set to a null value.&lt;/p&gt;

&lt;p&gt;Test coverage and fix to follow.&lt;/p&gt;</description>
                <environment>Ubuntu 10.04, PHP 5.3.2, Mongo 1.6.3</environment>
            <key id="12023">MODM-91</key>
            <summary>Document unnecessarily persisted when embedded documents have null properties</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="weaverryan">Ryan Weaver</reporter>
                        <labels>
                    </labels>
                <created>Wed, 20 Oct 2010 09:12:13 +0000</created>
                <updated>Wed, 24 Nov 2010 13:14:48 +0000</updated>
                    <resolved>Wed, 24 Nov 2010 13:14:48 +0000</resolved>
                            <version>1.0.0BETA2</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Hydration</component>
                <component>Persister</component>
                <component>UnitOfWork</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14585" author="weaverryan" created="Wed, 20 Oct 2010 09:21:56 +0000"  >&lt;p&gt;Tests and fix can be found here: &lt;a href=&quot;http://github.com/weaverryan/mongodb-odm/tree/invalid_changeset_on_null_properties&quot; class=&quot;external-link&quot;&gt;http://github.com/weaverryan/mongodb-odm/tree/invalid_changeset_on_null_properties&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Comments on the change welcome. One unrelated test was affected, which required a fix inside BasicDocumentPersister.&lt;/p&gt;</comment>
                    <comment id="14812" author="jwage" created="Wed, 24 Nov 2010 13:14:48 +0000"  >&lt;p&gt;This is fixed now with the latest refactoring of some internal parts.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-90] UnitOfWork incorrectly flushes certain documents with embedded documents on first flush</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-90</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;With documents that have embedded documents, the changeset is sometimes calculated incorrectly so that unmodified documents are flushed unnecessarily. This is similar in spirit to #&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/MODM-83&quot; title=&quot;UnitOfWork incorrectly updates all documents with embedded documents on flush&quot;&gt;&lt;del&gt;MODM-83&lt;/del&gt;&lt;/a&gt;, but this isn&apos;t covered by that fix.&lt;/p&gt;


&lt;p&gt;This can be seen when the document has an embedded document that uses a discriminator map. When calculating the changeset, the original value will have the discriminator field and value present while the actual value does not contain the discriminator field.&lt;/p&gt;

&lt;p&gt;Covering tests with fixes to follow shortly.&lt;/p&gt;</description>
                <environment>Ubuntu, PHP 5.3.2, Mongo 1.6.3</environment>
            <key id="12021">MODM-90</key>
            <summary>UnitOfWork incorrectly flushes certain documents with embedded documents on first flush</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="weaverryan">Ryan Weaver</reporter>
                        <labels>
                    </labels>
                <created>Wed, 20 Oct 2010 08:01:40 +0000</created>
                <updated>Wed, 20 Oct 2010 12:52:06 +0000</updated>
                    <resolved>Wed, 20 Oct 2010 12:52:06 +0000</resolved>
                            <version>1.0.0BETA2</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Hydration</component>
                <component>Persister</component>
                <component>UnitOfWork</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14584" author="weaverryan" created="Wed, 20 Oct 2010 08:42:18 +0000"  >&lt;p&gt;The covering test and fix can be found here: &lt;a href=&quot;http://github.com/weaverryan/mongodb-odm/tree/embedded_document_changeset_problem&quot; class=&quot;external-link&quot;&gt;http://github.com/weaverryan/mongodb-odm/tree/embedded_document_changeset_problem&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14587" author="avalanche123" created="Wed, 20 Oct 2010 12:52:06 +0000"  >&lt;p&gt;Fixed here - &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/01e02406f37a316399f4161d00b72efe43716173&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/01e02406f37a316399f4161d00b72efe43716173&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-89] CLONE -UnitOfWork incorrectly updates all documents with embedded documents on flush</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-89</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;I use the &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/MODM-83&quot; class=&quot;external-link&quot;&gt;MODM-83 fix,&lt;/a&gt; now i cant delete childrens with a other embedded document: &lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;The complete document&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;{
   &lt;span class=&quot;code-quote&quot;&gt;&quot;_id&quot;&lt;/span&gt; : ObjectId(&lt;span class=&quot;code-quote&quot;&gt;&quot;4caeea835634c915360a0000&quot;&lt;/span&gt;),
   &lt;span class=&quot;code-quote&quot;&gt;&quot;categories&quot;&lt;/span&gt; : {
     &lt;span class=&quot;code-quote&quot;&gt;&quot;0&quot;&lt;/span&gt; : {
       &lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt; : ObjectId(&lt;span class=&quot;code-quote&quot;&gt;&quot;4cbd55f55634c99177030000&quot;&lt;/span&gt;),
       &lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt; : &lt;span class=&quot;code-quote&quot;&gt;&quot;neue Kategorie&quot;&lt;/span&gt;,
       &lt;span class=&quot;code-quote&quot;&gt;&quot;questions&quot;&lt;/span&gt; : {
         &lt;span class=&quot;code-quote&quot;&gt;&quot;0&quot;&lt;/span&gt; : {
           &lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt; : ObjectId(&lt;span class=&quot;code-quote&quot;&gt;&quot;4cbd55f75634c99177040000&quot;&lt;/span&gt;),
           &lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt; : &lt;span class=&quot;code-quote&quot;&gt;&quot;neue Frage&quot;&lt;/span&gt;,
           &lt;span class=&quot;code-quote&quot;&gt;&quot;relevance&quot;&lt;/span&gt; : 0,
           &lt;span class=&quot;code-quote&quot;&gt;&quot;multi&quot;&lt;/span&gt; : 0,
           &lt;span class=&quot;code-quote&quot;&gt;&quot;answertype&quot;&lt;/span&gt; : 0,
           &lt;span class=&quot;code-quote&quot;&gt;&quot;other&quot;&lt;/span&gt; : 0
        }
      }
    }
  },
   &lt;span class=&quot;code-quote&quot;&gt;&quot;description&quot;&lt;/span&gt; : &lt;span class=&quot;code-quote&quot;&gt;&quot;pipapo!&quot;&lt;/span&gt;,
   &lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt; : &lt;span class=&quot;code-quote&quot;&gt;&quot;ich bin ein Katalog&quot;&lt;/span&gt;,
   &lt;span class=&quot;code-quote&quot;&gt;&quot;version&quot;&lt;/span&gt; : 1
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Now i add a new answer too the question:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;The question with the new answer&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;questions&quot;&lt;/span&gt; : {
         &lt;span class=&quot;code-quote&quot;&gt;&quot;0&quot;&lt;/span&gt; : {
           &lt;span class=&quot;code-quote&quot;&gt;&quot;answers&quot;&lt;/span&gt; : {
             &lt;span class=&quot;code-quote&quot;&gt;&quot;0&quot;&lt;/span&gt; : {
               &lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt; : ObjectId(&lt;span class=&quot;code-quote&quot;&gt;&quot;4cbd56b95634c99b5b090000&quot;&lt;/span&gt;),
               &lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt; : &lt;span class=&quot;code-quote&quot;&gt;&quot;neue Antwort&quot;&lt;/span&gt;
            }
          },
           &lt;span class=&quot;code-quote&quot;&gt;&quot;answertype&quot;&lt;/span&gt; : 0,
           &lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt; : ObjectId(&lt;span class=&quot;code-quote&quot;&gt;&quot;4cbd55f75634c99177040000&quot;&lt;/span&gt;),
           &lt;span class=&quot;code-quote&quot;&gt;&quot;multi&quot;&lt;/span&gt; : 0,
           &lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt; : &lt;span class=&quot;code-quote&quot;&gt;&quot;neue Frage&quot;&lt;/span&gt;,
           &lt;span class=&quot;code-quote&quot;&gt;&quot;other&quot;&lt;/span&gt; : 0,
           &lt;span class=&quot;code-quote&quot;&gt;&quot;relevance&quot;&lt;/span&gt; : 0
        } 
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;When i delete now the new answer i have a empty array and i cant delete the question from the categorie.&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;The unkillable question&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot;questions&quot;&lt;/span&gt; : {
         &lt;span class=&quot;code-quote&quot;&gt;&quot;0&quot;&lt;/span&gt; : {
           &lt;span class=&quot;code-quote&quot;&gt;&quot;answers&quot;&lt;/span&gt; : [
            
          ],
           &lt;span class=&quot;code-quote&quot;&gt;&quot;answertype&quot;&lt;/span&gt; : 0,
           &lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt; : ObjectId(&lt;span class=&quot;code-quote&quot;&gt;&quot;4cbd55f75634c99177040000&quot;&lt;/span&gt;),
           &lt;span class=&quot;code-quote&quot;&gt;&quot;multi&quot;&lt;/span&gt; : 0,
           &lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt; : &lt;span class=&quot;code-quote&quot;&gt;&quot;neue Frage&quot;&lt;/span&gt;,
           &lt;span class=&quot;code-quote&quot;&gt;&quot;other&quot;&lt;/span&gt; : 0,
           &lt;span class=&quot;code-quote&quot;&gt;&quot;relevance&quot;&lt;/span&gt; : 0
        }
      }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Its a unkillable entry now.&lt;br/&gt;
Sorry for my bad english.&lt;/p&gt;</description>
                <environment>OS X 10.6.4, PHP 5.3.2, Mongo 1.6.3 (can reproduce on Ubuntu 8.04.4 LTS, CentOS, Win 7, etc)</environment>
            <key id="12015">MODM-89</key>
            <summary>CLONE -UnitOfWork incorrectly updates all documents with embedded documents on flush</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="a.koss">Alexander Ko&#223;</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Oct 2010 06:51:13 +0000</created>
                <updated>Wed, 24 Nov 2010 14:52:29 +0000</updated>
                    <resolved>Wed, 24 Nov 2010 14:52:29 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Persister</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14813" author="jwage" created="Wed, 24 Nov 2010 13:19:10 +0000"  >&lt;p&gt;I don&apos;t understand the issue. Can you show some php code that shows what you are trying to persist?&lt;/p&gt;</comment>
                    <comment id="14828" author="jwage" created="Wed, 24 Nov 2010 14:52:29 +0000"  >&lt;p&gt;I&apos;m pretty certain this is no longer an issue.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-88] Selecting a subset of properties and then flushing causes database corruption</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-88</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Pretty simple to reproduce. Here is the code from our own application. All we wanted to do was to select a subset of fields from the Article document, and found that if we did that and then did anything to cause the DM to mark those documents as modified, when they get flushed to mongo it corrupts your data. For example, article has a property &quot;published&quot; which is set to 1, and after I run this code below, it will set the &quot;published&quot; property to &quot;null&quot; on all documents. &lt;/p&gt;


&lt;p&gt;        $class = &apos;Bundle\ArticleBundle\Document\Article&apos;;&lt;br/&gt;
        $documents = $dm-&amp;gt;createQuery($class)&lt;del&gt;&amp;gt;select(&apos;_id&apos;,&apos;title&apos;,&apos;user&apos;)&lt;/del&gt;&amp;gt;execute();&lt;br/&gt;
        foreach($documents as $document) &lt;/p&gt;
{
            $document-&amp;gt;getTitle();
        }
&lt;p&gt;        $dm-&amp;gt;flush();&lt;br/&gt;
        exit;&lt;/p&gt;
</description>
                <environment></environment>
            <key id="12013">MODM-88</key>
            <summary>Selecting a subset of properties and then flushing causes database corruption</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="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jseverson">Jay Severson</reporter>
                        <labels>
                    </labels>
                <created>Mon, 18 Oct 2010 15:25:49 +0000</created>
                <updated>Wed, 24 Nov 2010 14:10:10 +0000</updated>
                    <resolved>Wed, 24 Nov 2010 14:10:10 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Document Manager</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14814" author="jwage" created="Wed, 24 Nov 2010 14:10:10 +0000"  >&lt;p&gt;This is not a problem anymore after the recent refactoring.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-87] get_class() expects parameter 1 to be object, array given </title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-87</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;The commit on October 4th introduced a bug for me.&lt;br/&gt;
Exactly this line:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/8bd3aef4055cfded62687d5ad0e762e3f12a473d#commitcomment-167197&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/8bd3aef4055cfded62687d5ad0e762e3f12a473d#commitcomment-167197&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now I always get an error, because embeddedDocument is an array, and so get_class fails.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12000">MODM-87</key>
            <summary>get_class() expects parameter 1 to be object, array given </summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="sebastian.hoitz">Sebastian Hoitz</reporter>
                        <labels>
                    </labels>
                <created>Tue, 12 Oct 2010 10:09:34 +0000</created>
                <updated>Wed, 24 Nov 2010 14:10:31 +0000</updated>
                    <resolved>Wed, 24 Nov 2010 14:10:31 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14581" author="jwage" created="Tue, 19 Oct 2010 20:48:22 +0000"  >&lt;p&gt;Can you give the error you get? maybe the document definitions and code you&apos;re using when flushing?&lt;/p&gt;</comment>
                    <comment id="14815" author="jwage" created="Wed, 24 Nov 2010 14:10:31 +0000"  >&lt;p&gt;This is not a problem anymore after the recent refactoring!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-86] Order of keys in embedded document need to be enforced</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-86</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Order of keys in embedded bson hashes in mongodb matters, so you can&apos;t $pullAll an embedded document if the order of keys is different from the one in mongodb:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;code&lt;/tt&gt;&lt;br/&gt;
{&lt;br/&gt;
  _id: ObjectId(&apos;123&apos;),&lt;br/&gt;
  addresses: [&lt;br/&gt;
    &lt;/p&gt;
{
      street: &apos;SomeStreet&apos;,
      zipCode: &apos;11111&apos;
    }
&lt;p&gt;,&lt;br/&gt;
    &lt;/p&gt;
{
      zipCode: &apos;22222&apos;,
      street: &apos;AnotherStreet&apos;
    }
&lt;p&gt;,&lt;br/&gt;
  ]&lt;br/&gt;
}&lt;br/&gt;
&lt;tt&gt;/code&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;then query like:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;code&lt;/tt&gt;&lt;br/&gt;
db.collection.update({_id: ObjectId(&apos;123&apos;)}, {$pullAll: {addresses: [ &lt;/p&gt;
{ zipCode: &apos;11111&apos;, street: &apos;SomeStreet&apos; }
&lt;p&gt; ]}})&lt;br/&gt;
&lt;tt&gt;/code&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;would fail, because the order of keys (&apos;zipCode&apos;, &apos;street&apos;) is different from the one stored in mongo (&apos;street&apos;, &apos;zipCode&apos;). More can be found here &lt;a href=&quot;http://jira.mongodb.org/browse/SERVER-1914&quot; class=&quot;external-link&quot;&gt;http://jira.mongodb.org/browse/SERVER-1914&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Therefore, we need to force the order on every insert and update for consistency.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11997">MODM-86</key>
            <summary>Order of keys in embedded document need to be enforced</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="avalanche123">Bulat Shakirzyanov</assignee>
                                <reporter username="avalanche123">Bulat Shakirzyanov</reporter>
                        <labels>
                    </labels>
                <created>Mon, 11 Oct 2010 16:12:08 +0000</created>
                <updated>Wed, 24 Nov 2010 14:10:48 +0000</updated>
                    <resolved>Wed, 24 Nov 2010 14:10:48 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                <version>1.0.0ALPHA2</version>
                <version>1.0.0BETA1</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Persister</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14816" author="jwage" created="Wed, 24 Nov 2010 14:10:48 +0000"  >&lt;p&gt;This is not a problem anymore after the recent refactoring!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-85] Saving a array over the top of a PersistentCollection results in duplicated data</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-85</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;If you take an document that has a referenceMany and overwrite a PersistentCollection of data with an array, even of the same data, the data is appended to the collection instead of replacing it.&lt;/p&gt;</description>
                <environment>Mongo 1.6.1, opensky/mongo-odm/master</environment>
            <key id="11991">MODM-85</key>
            <summary>Saving a array over the top of a PersistentCollection results in duplicated data</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="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="cranberyxl">Andy Stanberry</reporter>
                        <labels>
                    </labels>
                <created>Fri, 8 Oct 2010 17:57:14 +0000</created>
                <updated>Wed, 24 Nov 2010 14:11:03 +0000</updated>
                    <resolved>Wed, 24 Nov 2010 14:11:03 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14557" author="sebastian.hoitz" created="Tue, 12 Oct 2010 10:07:55 +0000"  >&lt;p&gt;Are you using the most recent version of Doctrine MongoDB ODM?&lt;/p&gt;

&lt;p&gt;I&apos;m asking because there was a bug fix for something where all embedded documents were duplicated.&lt;/p&gt;

&lt;p&gt;However I&apos;m also currently investigating a bug where in some cases only one entry does not get removed (although $pullAll is called correctly).&lt;/p&gt;</comment>
                    <comment id="14582" author="jwage" created="Tue, 19 Oct 2010 20:49:57 +0000"  >&lt;p&gt;Bulat, this is the same issue where PersistentCollection is never initialized so thats why the array_diff always appends the data with a $pushAll. Remember we talked about it? we can fix it just need to chat about it for a bit.&lt;/p&gt;</comment>
                    <comment id="14817" author="jwage" created="Wed, 24 Nov 2010 14:11:03 +0000"  >&lt;p&gt;This is not a problem anymore after the recent refactoring!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-84] prePersist and postPersist called twice</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-84</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;It appears that the prePersist and postPersist lifecycle events are called twice when persisting and removing a document. Not sure yet if this happens because its an inherited class, will setup a test to try and show behavior.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11983">MODM-84</key>
            <summary>prePersist and postPersist called twice</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jseverson">Jay Severson</reporter>
                        <labels>
                    </labels>
                <created>Wed, 6 Oct 2010 19:08:59 +0000</created>
                <updated>Wed, 24 Nov 2010 14:11:23 +0000</updated>
                    <resolved>Wed, 24 Nov 2010 14:11:23 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Events</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14548" author="jwage" created="Fri, 8 Oct 2010 17:11:46 +0000"  >&lt;p&gt;I tried to setup a test for this but could not replicate it.&lt;/p&gt;</comment>
                    <comment id="14818" author="jwage" created="Wed, 24 Nov 2010 14:11:23 +0000"  >&lt;p&gt;This is fixed now as well.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-81] No reference to a loaded document if proxy id = document id</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-81</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;If I load a document and it has an internal reference to the same document with the same ID, only responds to changes in the proxy document. The main document will not be considered and any change has no effect.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11958">MODM-81</key>
            <summary>No reference to a loaded document if proxy id = document id</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="tecbot">Thomas Adam</reporter>
                        <labels>
                    </labels>
                <created>Tue, 28 Sep 2010 03:52:52 +0000</created>
                <updated>Wed, 24 Nov 2010 14:12:10 +0000</updated>
                    <resolved>Wed, 24 Nov 2010 14:12:10 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                <component>UnitOfWork</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14523" author="jwage" created="Mon, 4 Oct 2010 19:47:15 +0000"  >&lt;p&gt;Can I see a test case?&lt;/p&gt;</comment>
                    <comment id="14526" author="tecbot" created="Tue, 5 Oct 2010 02:24:23 +0000"  >&lt;p&gt;test case: &lt;a href=&quot;http://github.com/tecbot/mongodb-odm/commit/df4e3102b4b29f7e7ad6aa24800457b52f93b14d&quot; class=&quot;external-link&quot;&gt;http://github.com/tecbot/mongodb-odm/commit/df4e3102b4b29f7e7ad6aa24800457b52f93b14d&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14819" author="jwage" created="Wed, 24 Nov 2010 14:12:10 +0000"  >&lt;p&gt;Thanks! This is fixed now. The reference will now be the same instance as the root document itself instead of another instance of the same document.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-80] Changeset for embedded documents calculates to an unnecessary pullAll() and pushAll() in some cases.</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-80</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;When embedded documents are persisted and then some of them are removed in just the right way, the resulting update will issue a $pullAll for ALL of the embedded documents and then a $pushAll on whichever embedded documents weren&apos;t actually removed. Obviously, only a $pullAll on the removed items is necessary.&lt;/p&gt;

&lt;p&gt;Additionally, while the $pullAll and the $pushAll seem like they should add up to the correct finish (though inefficient), the removed items appear to not be removed correctly. The $pullAll falls correctly into the if loop found here: &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/blob/master/lib/Doctrine/ODM/MongoDB/Persisters/BasicDocumentPersister.php#L230&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/blob/master/lib/Doctrine/ODM/MongoDB/Persisters/BasicDocumentPersister.php#L230&lt;/a&gt;, but the end result of that $pullAll in this case is that some items are not removed.&lt;/p&gt;

&lt;p&gt;A test case for this is here: &lt;a href=&quot;http://github.com/weaverryan/mongodb-odm/commit/9968697a2c07e31ecfdd8d55ecbf9bf39183d01e&quot; class=&quot;external-link&quot;&gt;http://github.com/weaverryan/mongodb-odm/commit/9968697a2c07e31ecfdd8d55ecbf9bf39183d01e&lt;/a&gt;. The first case, testModifyGroupsArrayDirectly() tests for this. The second case relates to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/MODM-79&quot; title=&quot;Referenced and Embedded document duplicates are inserted&quot;&gt;&lt;del&gt;MODM-79&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thanks - I&apos;ve found the issue particular strange to nail down and inconsistent. If you spot any issues in my test cases, let me know.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11932">MODM-80</key>
            <summary>Changeset for embedded documents calculates to an unnecessary pullAll() and pushAll() in some cases.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="weaverryan">Ryan Weaver</reporter>
                        <labels>
                    </labels>
                <created>Mon, 20 Sep 2010 07:17:51 +0000</created>
                <updated>Wed, 24 Nov 2010 14:12:27 +0000</updated>
                    <resolved>Wed, 24 Nov 2010 14:12:27 +0000</resolved>
                            <version>1.0.0BETA2</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Persister</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14820" author="jwage" created="Wed, 24 Nov 2010 14:12:27 +0000"  >&lt;p&gt;This is not a problem anymore after the recent refactoring!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-79] Referenced and Embedded document duplicates are inserted</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-79</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;I have a document with several collections referencing documents in other collections.&lt;/p&gt;

&lt;p&gt;Doctrine ODM seems to have issues with ArrayCollections and realizing that elements are being taken out. I call ArrayCollection-&amp;gt;clear() on those collections but when calculating the changeset Doctrine does not realize that some were deleted.&lt;/p&gt;

&lt;p&gt;My scenario is following: I have a REST API. On the API I use Doctrine ODM as data backend.&lt;/p&gt;

&lt;p&gt;Now when I get a request to update an object, I get the passed ID of the object, and populate all the fields.&lt;/p&gt;

&lt;p&gt;However with collections I call clear() on the collection and then re-add all passed elements. This might not be a very elegant solution, but I don&apos;t have to worry about added / changed / deleted items. I pretty much just set a new collection.&lt;/p&gt;

&lt;p&gt;However, when persisting this document, Doctrine does not seem to notice that I cleared the collection. It just adds all the objects I added to the collection. Therefore I have a lot of duplicate items in my collection.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11916">MODM-79</key>
            <summary>Referenced and Embedded document duplicates are inserted</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="sebastian.hoitz">Sebastian Hoitz</reporter>
                        <labels>
                    </labels>
                <created>Mon, 13 Sep 2010 12:54:17 +0000</created>
                <updated>Wed, 24 Nov 2010 14:13:02 +0000</updated>
                    <resolved>Wed, 24 Nov 2010 14:13:02 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Persister</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14377" author="a.koss" created="Wed, 15 Sep 2010 03:39:23 +0000"  >&lt;p&gt;i have the same problem.&lt;br/&gt;
when i flush persistant data i get duplicated entries. &lt;img class=&quot;emoticon&quot; src=&quot;http://www.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;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$this-&amp;gt;_dm-&amp;gt;persist($Opinion);&lt;br/&gt;
$this-&amp;gt;_dm-&amp;gt;flush();&lt;/p&gt;&lt;/blockquote&gt;</comment>
                    <comment id="14418" author="weaverryan" created="Mon, 20 Sep 2010 07:09:38 +0000"  >&lt;p&gt;I believe I&apos;m replicating this issue and have a test case for it here: &lt;a href=&quot;http://github.com/weaverryan/mongodb-odm/commit/9968697a2c07e31ecfdd8d55ecbf9bf39183d01e&quot; class=&quot;external-link&quot;&gt;http://github.com/weaverryan/mongodb-odm/commit/9968697a2c07e31ecfdd8d55ecbf9bf39183d01e&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The second test case, testReplaceEntireGroupsArray() displays the above error. The update contains a pushAll() for the one embedded document that remains, but no pullAll() to remove the embedded documents that no longer exist.&lt;/p&gt;

&lt;p&gt;The first test case, testModifyGroupsArrayDirectly() tests for a different, related issue. I&apos;ll open a separate ticket for it.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="14423" author="sebastian.hoitz" created="Mon, 20 Sep 2010 12:25:31 +0000"  >&lt;p&gt;It looks like the changeset is calculated correctly.&lt;br/&gt;
So there must be a fault afterwards.&lt;/p&gt;

&lt;p&gt;Maybe it has to do with MongoDB&apos;s limitation of just sending one atomic operator on one field at a time?&lt;/p&gt;

&lt;p&gt;Can we use a $set on a collection? Or don&apos;t we do this because we would also re-send unmodified entries?&lt;/p&gt;</comment>
                    <comment id="14446" author="sebastian.hoitz" created="Wed, 22 Sep 2010 06:37:31 +0000"  >&lt;p&gt;This commit fixed the issue for me:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/6b78658b74507edafc59f0ff004d51d6be0e45f5&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/6b78658b74507edafc59f0ff004d51d6be0e45f5&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks @jwage &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.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;</comment>
                    <comment id="14821" author="jwage" created="Wed, 24 Nov 2010 14:13:02 +0000"  >&lt;p&gt;This is for sure fixed now with our recent refactoring.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-77] Add &quot;addToSet&quot; strategy for collections / embedMany / referenceMany</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-77</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;There are cases when collection must not contain duplicates. Mongo has &quot;$addToSet&quot; atomic command for such cases. It would be great to have a separate strategy for that command when persisting collections / embedMany / referenceMany.&lt;/p&gt;

&lt;p&gt;As far as I understand, Doctrine already supports &quot;set&quot; and &quot;pushPull&quot; strategy, so adding &quot;addToSet&quot; strategy should be possible, right?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11913">MODM-77</key>
            <summary>Add &quot;addToSet&quot; strategy for collections / embedMany / referenceMany</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vladar">Vladimir Razuvaev</reporter>
                        <labels>
                    </labels>
                <created>Mon, 13 Sep 2010 02:17:27 +0000</created>
                <updated>Wed, 24 Nov 2010 14:35:37 +0000</updated>
                    <resolved>Wed, 24 Nov 2010 14:35:37 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Persister</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14823" author="jwage" created="Wed, 24 Nov 2010 14:35:37 +0000"  >&lt;p&gt;Sure, it was simple to add. If you specify $addToSet now it will use that instead of $pushAll to add insert new elements in a collection.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-75] mappedSuperclass and embedded document not working with yaml mapping</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-75</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;all documents inherits from an abstract class   Cgd\DomainObject\DomainObjectAbstract&lt;/p&gt;

&lt;p&gt;The document  App\Entity\Contact\Contact    has many  App\Entity\Contact\Program&lt;/p&gt;



&lt;p&gt;abstract class Cgd\DomainObject\DomainObjectAbstract&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;mappedSuperclass&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;#Cgd.DomainObject.DomainObjectAbstract.dcm.yml
Cgd\DomainObject\DomainObjectAbstract:
  type: mappedSuperclass
  fields:
    id:
      fieldName: id
      id: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    createdAt:
      fieldName: createdAt
      type: date
    updatedAt:
      fieldName: updatedAt
      type: date
  lifecycleCallbacks:
    prePersist: [onPreInsert]
    preUpdate: [onPreUpdate]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Here the inherited class &lt;/p&gt;

&lt;p&gt;class App\Entity\Contact\Contact extends Cgd\DomainObject\DomainObjectAbstract&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;InheritedClass&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;#App.Entity.Contact.Contact.dcm.yml
App\Entity\Contact\Contact:
  collection: contacts
  type: document
  fields:
    email:
      fieldName: email
      type: string
    status:
      fieldName: status
      type: &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;
  embedMany:
    programs:
      targetDocument: App\Entity\Contact\Program
      cascade: all
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The embedded&lt;/p&gt;

&lt;p&gt;class App\Entity\Contact\Program extends Cgd\DomainObject\DomainObjectAbstract&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;embeddedDocument&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;#App.Entity.Contact.Program.dcm.yml
App\Entity\Contact\Program:
  type: embeddedDocument
  fields:
    name:
      fieldName: name
      type: string
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;No field from abstract class are populated in embedded document&lt;/p&gt;</description>
                <environment></environment>
            <key id="11906">MODM-75</key>
            <summary>mappedSuperclass and embedded document not working with yaml mapping</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jenreve">julien rollin</reporter>
                        <labels>
                    </labels>
                <created>Fri, 10 Sep 2010 10:06:53 +0000</created>
                <updated>Wed, 24 Nov 2010 14:49:31 +0000</updated>
                    <resolved>Wed, 24 Nov 2010 14:49:31 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14319" author="jenreve" created="Fri, 10 Sep 2010 11:21:58 +0000"  >&lt;p&gt;if i call &lt;/p&gt;

&lt;p&gt;$dm-&amp;gt;persist($contact);&lt;br/&gt;
$dm-&amp;gt;flush();&lt;/p&gt;

&lt;p&gt;properties  createdAt and updatedAt are saved to contact document only&lt;/p&gt;



&lt;p&gt;if i call &lt;/p&gt;

&lt;p&gt;$dm-&amp;gt;persist($program);&lt;br/&gt;
$dm-&amp;gt;persist($contact);&lt;br/&gt;
$dm-&amp;gt;flush();&lt;/p&gt;

&lt;p&gt;properties  createdAt and updatedAt are saved to contact and embedded documents.&lt;/p&gt;

&lt;p&gt;So is it the   &quot;cascade: all&quot;  property the problem ?&lt;/p&gt;</comment>
                    <comment id="14322" author="jwage" created="Fri, 10 Sep 2010 13:29:25 +0000"  >&lt;p&gt;Are you using the absolute latest version from git? we made some changes recently to cascading and embedded documents. It is not necessary anymore to specify any cascading options as it does not make sense for embedded documents. it should and does cascade by default now for embedded documents.&lt;/p&gt;</comment>
                    <comment id="14324" author="jenreve" created="Fri, 10 Sep 2010 14:10:02 +0000"  >&lt;p&gt;yes i use  the remote origin/master   (i just did an update to de2e671201ef5a97e2a970f35cc94b5ad3590bb5)&lt;/p&gt;

&lt;p&gt;but actually, since your my comments and after yours,  i got this beautiful fatal error  (unknown before )&lt;/p&gt;

&lt;p&gt;Fatal error: Class Doctrine\ODM\MongoDB\Query\Lexer contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Doctrine\Common\Lexer::_getType) in D:\web\php\doctrine2-mongodb\lib\Doctrine\ODM\MongoDB\Query\Lexer.php on line 33&lt;/p&gt;

&lt;p&gt;edit : rechecking all dependencies (doctrine/common, etc )&lt;/p&gt;

&lt;p&gt;edit 2 : last checkout resolved cascade persist&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-74] lifecycleCallbacks are not inherited from mappedSuperclass in yaml mapping</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-74</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;The abstract class : &lt;/p&gt;

&lt;p&gt;abstract class Cgd\DomainObject\DomainObjectAbstract&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;mappedSuperclass&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;#Cgd.DomainObject.DomainObjectAbstract.dcm.yml
Cgd\DomainObject\DomainObjectAbstract:
  type: mappedSuperclass
  fields:
    id:
      fieldName: id
      id: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    createdAt:
      fieldName: createdAt
      type: date
    updatedAt:
      fieldName: updatedAt
      type: date
  lifecycleCallbacks:
    prePersist: [onPreInsert]
    preUpdate: [onPreUpdate]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;Here the inherited class &lt;/p&gt;

&lt;p&gt;class App\Entity\Contact\Contact extends Cgd\DomainObject\DomainObjectAbstract&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;InheritedClass&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;#App.Entity.Contact.Contact.dcm.yml
App\Entity\Contact\Contact:
  collection: contacts
  type: document
  fields:
    email:
      fieldName: email
      type: string
    status:
      fieldName: status
      type: &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If i add the lifecycleCallbacks in the InheritedClass  yaml config. Events are working &lt;/p&gt;</description>
                <environment></environment>
            <key id="11905">MODM-74</key>
            <summary>lifecycleCallbacks are not inherited from mappedSuperclass in yaml mapping</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jenreve">julien rollin</reporter>
                        <labels>
                    </labels>
                <created>Fri, 10 Sep 2010 09:46:04 +0000</created>
                <updated>Wed, 24 Nov 2010 14:36:10 +0000</updated>
                    <resolved>Wed, 24 Nov 2010 14:36:10 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14327" author="jenreve" created="Fri, 10 Sep 2010 15:01:20 +0000"  >&lt;p&gt;fixed in current master branch&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-72] New property &apos;options&apos; in Annotations</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-72</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;It would be great for many purposes to add a property options to document annotations like this:&lt;/p&gt;

&lt;p&gt;/** @Field(type=&quot;mytype&quot;, options={}) */ &lt;/p&gt;

&lt;p&gt;the options should also be implemented in the MetadataClass.&lt;/p&gt;

&lt;p&gt;See also discussion:&lt;br/&gt;
&lt;a href=&quot;http://groups.google.de/group/doctrine-user/browse_thread/thread/71d29b8284beee86&quot; class=&quot;external-link&quot;&gt;http://groups.google.de/group/doctrine-user/browse_thread/thread/71d29b8284beee86&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="11889">MODM-72</key>
            <summary>New property &apos;options&apos; in Annotations</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="sterie">Stefan Riehl</reporter>
                        <labels>
                    </labels>
                <created>Mon, 6 Sep 2010 14:06:09 +0000</created>
                <updated>Wed, 24 Nov 2010 14:45:32 +0000</updated>
                    <resolved>Wed, 24 Nov 2010 14:45:32 +0000</resolved>
                            <version>1.0.0BETA1</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14825" author="jwage" created="Wed, 24 Nov 2010 14:45:32 +0000"  >&lt;p&gt;Fixed here &lt;a href=&quot;https://github.com/doctrine/mongodb-odm/commit/16e0ac113c557c1fb73e3f31eec93176ad5992a1&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/mongodb-odm/commit/16e0ac113c557c1fb73e3f31eec93176ad5992a1&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-70] Updates of documents after read</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-70</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;When I save a document and then read it again updated the document with the initial values.&lt;/p&gt;

&lt;p&gt;The following log output when saving Doctrine:&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;Array
(
    [storing] =&amp;gt; 1
    [file] =&amp;gt; /app/tests/cases/models/asset/test.swf
    [document] =&amp;gt; Array
        (
            [filename] =&amp;gt; a3f06b4b882ee28ee8d8c7a5e6ab67e6.swf
            [php] =&amp;gt; ass
        )

    [class] =&amp;gt; Documents\Assets\Asset
    [db] =&amp;gt; test
    [collection] =&amp;gt; assets_files
)

Array
(
    [batchInsert] =&amp;gt; 1
    [num] =&amp;gt; 1
    [data] =&amp;gt; Array
        (
            [00000000341a62a40000000001574585] =&amp;gt; Array
                (
                    [cS] =&amp;gt; 3
                    [rS] =&amp;gt; 3
                    [co] =&amp;gt; 0
                    [ca] =&amp;gt; 0
                    [lvl] =&amp;gt; 0
                    [nb] =&amp;gt; 0
                    [sex] =&amp;gt; 0
                    [na] =&amp;gt; Building01
                    [typ] =&amp;gt; building
                    [as] =&amp;gt; Array
                        (
                            [$ref] =&amp;gt; assets_files
                            [$id] =&amp;gt; MongoId &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;
                                (
                                )

                            [$db] =&amp;gt; test
                        )

                )

        )

    [class] =&amp;gt; Documents\Assets\MapAsset
    [db] =&amp;gt; test
    [collection] =&amp;gt; map_assets
)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then read:&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;Array
(
    [findOne] =&amp;gt; 1
    [query] =&amp;gt; Array
        (
            [_id] =&amp;gt; MongoId &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;
                (
                )

        )

    [fields] =&amp;gt; Array
        (
        )

    [class] =&amp;gt; Documents\Assets\MapAsset
    [db] =&amp;gt; test
    [collection] =&amp;gt; map_assets
)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then check for updates Document:&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;dm-&amp;gt;getUnitOfWork()-&amp;gt;computeChangeSets();
$update = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;getUnitOfWork()-&amp;gt;getDocumentPersister(&apos;Documents\Assets\MapAsset&apos;)-&amp;gt;prepareUpdateData($mapAsset);
print_r($update);

Array
(
    [$set] =&amp;gt; Array
        (
            [cS] =&amp;gt; 3
            [rS] =&amp;gt; 3
            [co] =&amp;gt; 0
            [ca] =&amp;gt; 0
            [lvl] =&amp;gt; 0
            [nb] =&amp;gt; 0
            [sex] =&amp;gt; 0
            [na] =&amp;gt; Building01
            [typ] =&amp;gt; building
            [as] =&amp;gt; Array
                (
                    [$ref] =&amp;gt; assets_files
                    [$id] =&amp;gt; MongoId &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;
                        (
                        )

                    [$db] =&amp;gt; test
                )

        )

)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Why is there an update even though it set the initial values? In Mongo are the values set correctly!&lt;/p&gt;

&lt;p&gt;Then I run a flush:&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;Array
(
    [update] =&amp;gt; 1
    [criteria] =&amp;gt; Array
        (
            [_id] =&amp;gt; MongoId &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;
                (
                )

        )

    [newObj] =&amp;gt; Array
        (
            [$set] =&amp;gt; Array
                (
                    [uploadDate] =&amp;gt; 0.63800000 1283421657
                    [length] =&amp;gt; 4222
                    [chunkSize] =&amp;gt; 262144
                    [md5] =&amp;gt; 2af70cb102026bde0cf9f181780b642c
                )

        )

    [options] =&amp;gt; Array
        (
        )

    [class] =&amp;gt; Documents\Assets\Asset
    [db] =&amp;gt; test
    [collection] =&amp;gt; assets_files
)

Array
(
    [update] =&amp;gt; 1
    [criteria] =&amp;gt; Array
        (
            [_id] =&amp;gt; MongoId &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;
                (
                )

        )

    [newObj] =&amp;gt; Array
        (
            [$set] =&amp;gt; Array
                (
                    [cS] =&amp;gt; 3
                    [rS] =&amp;gt; 3
                    [co] =&amp;gt; 0
                    [ca] =&amp;gt; 0
                    [lvl] =&amp;gt; 0
                    [nb] =&amp;gt; 0
                    [sex] =&amp;gt; 0
                    [na] =&amp;gt; Building01
                    [typ] =&amp;gt; building
                    [as] =&amp;gt; Array
                        (
                            [$ref] =&amp;gt; assets_files
                            [$id] =&amp;gt; MongoId &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;
                                (
                                )

                            [$db] =&amp;gt; test
                        )

                )

        )

    [options] =&amp;gt; Array
        (
        )

    [class] =&amp;gt; Documents\Assets\MapAsset
    [db] =&amp;gt; test
    [collection] =&amp;gt; map_assets
)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;1st Doctrine update GridFS file and destroyed it! Wrong value for uploadDate and the file can then be displayed in the browser no longer!&lt;/p&gt;

&lt;p&gt;2nd Why did he updatet The Document with the same values that are already there in Mongo and the initial values are?&lt;/p&gt;

&lt;p&gt;Here is my test code:&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;$asset = APP_TEST_CASES . DS . &apos;models&apos; . DS . &apos;asset&apos; . DS . &apos;test.swf&apos;;
$assetInfo = pathinfo($asset);
$assetName =  md5($assetInfo[&apos;basename&apos;] . time() . mt_rand()) . &apos;.&apos; . $assetInfo[&apos;extension&apos;];
$assetFile = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Documents\Assets\Asset($asset, $assetName);

$cSpan = 3;
$rSpan = 3;
$mapAsset = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Documents\Assets\MapAsset(&apos;Building01&apos;, &apos;building&apos;, $cSpan, $rSpan, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, $assetFile);
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($mapAsset-&amp;gt;getColumnSpan(), $cSpan);
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($mapAsset-&amp;gt;getRowSpan(), $rSpan);
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEqual($mapAsset-&amp;gt;getSpans(), array(&apos;columnSpan&apos; =&amp;gt; $cSpan, &apos;rowSpan&apos; =&amp;gt; $rSpan));

$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;persist($mapAsset);
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;flush();
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;refresh($mapAsset);

$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;getUnitOfWork()-&amp;gt;computeChangeSets();
$update = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;getUnitOfWork()-&amp;gt;getDocumentPersister(&apos;Documents\Assets\MapAsset&apos;)-&amp;gt;prepareUpdateData($mapAsset);
debug($update);
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here is my test Documents:&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;namespace Documents\Assets;

/**
 * @Document(collection=&lt;span class=&quot;code-quote&quot;&gt;&quot;assets_files&quot;&lt;/span&gt;)
 */
class Asset {
	/**
	 * @Id
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_id;
	/**
	 * @File
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_file;
	/**
	 * @&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;filename&quot;&lt;/span&gt;)
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_filename;
	/**
	 * @Field(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;uploadDate&quot;&lt;/span&gt;)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_uploadDate;
	/**
	 * @Field(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;length&quot;&lt;/span&gt;)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_length;
	/**
	 * @Field(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;chunkSize&quot;&lt;/span&gt;)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_chunkSize;
	/**
	 * @Field(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;md5&quot;&lt;/span&gt;)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_md5;
	/**
	 * @Field(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;contentType&quot;&lt;/span&gt;)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_contentType;
	/**
	 * @Field(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;metadata&quot;&lt;/span&gt;)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_metadata;

	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct($file, $filename = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_file = $file;
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_filename = $filename;
	}
	
	&lt;span class=&quot;code-comment&quot;&gt;// ..
&lt;/span&gt;}

namespace Documents\Assets;

/**
 * @Document(collection=&lt;span class=&quot;code-quote&quot;&gt;&quot;map_assets&quot;&lt;/span&gt;)
 */
class MapAsset {
	/**
	 * @Id
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_id;

	/**
	 * @ReferenceOne(
	 *	targetDocument=&lt;span class=&quot;code-quote&quot;&gt;&quot;Documents\Assets\Asset&quot;&lt;/span&gt;,
	 *	name=&lt;span class=&quot;code-quote&quot;&gt;&quot;as&quot;&lt;/span&gt;,
	 *	cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;}
	 *	)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; Documents\Assets\Asset
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_asset;

	&lt;span class=&quot;code-comment&quot;&gt;// ..
&lt;/span&gt;}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
</description>
                <environment>Mongodb 1.6 (64-bit + Google V8)</environment>
            <key id="11870">MODM-70</key>
            <summary>Updates of documents after read</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/blocker.png">Blocker</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="avalanche123">Bulat Shakirzyanov</assignee>
                                <reporter username="tecbot">Thomas Adam</reporter>
                        <labels>
                    </labels>
                <created>Thu, 2 Sep 2010 06:21:33 +0000</created>
                <updated>Wed, 24 Nov 2010 14:48:43 +0000</updated>
                    <resolved>Wed, 24 Nov 2010 14:48:43 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Persister</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14232" author="tecbot" created="Thu, 2 Sep 2010 06:33:05 +0000"  >&lt;p&gt;I have just seen. The read out after each of the Documents with the same values updated!&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;$user = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;findOne(&apos;Documents\User&apos;, array(&apos;snu.id&apos; =&amp;gt; (&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;) $snid)); &lt;span class=&quot;code-comment&quot;&gt;//, array(&apos;snu.friends&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;));
&lt;/span&gt;$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;getUnitOfWork()-&amp;gt;computeChangeSets();
$update = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;getUnitOfWork()-&amp;gt;getDocumentPersister(&apos;Documents\User&apos;)-&amp;gt;prepareUpdateData($user);
print_r($update); die();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;print all values!!!!&lt;/p&gt;</comment>
                    <comment id="14243" author="jwage" created="Thu, 2 Sep 2010 15:03:44 +0000"  >&lt;p&gt;Hi, can you make a simplified phpunit test case?&lt;/p&gt;</comment>
                    <comment id="14245" author="tecbot" created="Thu, 2 Sep 2010 15:37:58 +0000"  >&lt;p&gt;I&apos;ve just seen the &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/MODM-66&quot; title=&quot;Bug when persisting referenced collection&quot;&gt;&lt;del&gt;MODM-66&lt;/del&gt;&lt;/a&gt; is exactly the same errors.&lt;br/&gt;
It is the initial value after a refresh or read at a subsequent flush again highlighted as an update and it is doubly in Mongo!&lt;/p&gt;

&lt;p&gt;I can not just create a test case.&lt;/p&gt;</comment>
                    <comment id="14246" author="jwage" created="Thu, 2 Sep 2010 15:52:41 +0000"  >&lt;p&gt;Thanks, I see it is the same issue in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/MODM-66&quot; title=&quot;Bug when persisting referenced collection&quot;&gt;&lt;del&gt;MODM-66&lt;/del&gt;&lt;/a&gt;. We&apos;ll have a look and see what is wrong. Thanks, Jon&lt;/p&gt;</comment>
                    <comment id="14292" author="tecbot" created="Mon, 6 Sep 2010 14:36:40 +0000"  >&lt;p&gt;Test Case Added&lt;/p&gt;</comment>
                    <comment id="14294" author="avalanche123" created="Mon, 6 Sep 2010 15:20:51 +0000"  >&lt;p&gt;should be fixed here &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/tree/MODM-70&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/tree/MODM-70&lt;/a&gt;, Jon please review.&lt;br/&gt;
The issue was cause due to the fact, that after hydration in UnitOfWork::getOrCreateDocument() we used the resultset from mongo as originalDocumentData, which in case field names were different from document properties led to wrong changeset calculation&lt;/p&gt;</comment>
                    <comment id="14295" author="tecbot" created="Mon, 6 Sep 2010 15:34:53 +0000"  >&lt;p&gt;Fantastic! it works. Many many thanks &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.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;</comment>
                    <comment id="14301" author="sebastian.hoitz" created="Tue, 7 Sep 2010 08:34:15 +0000"  >&lt;p&gt;I can also say that it works. This should be resolved.&lt;/p&gt;</comment>
                    <comment id="14314" author="tecbot" created="Fri, 10 Sep 2010 01:37:35 +0000"  >&lt;p&gt;When it is added into the master branch?&lt;/p&gt;</comment>
                    <comment id="14826" author="jwage" created="Wed, 24 Nov 2010 14:48:43 +0000"  >&lt;p&gt;This is fixed now due to some other refactoring we did. Committed test here &lt;a href=&quot;https://github.com/doctrine/mongodb-odm/commit/bfe54c52ac242181392c6c8f9af04c9885b53db8&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/mongodb-odm/commit/bfe54c52ac242181392c6c8f9af04c9885b53db8&lt;/a&gt; and it is passing. Thanks!&lt;/p&gt;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                                <inwardlinks description="is duplicated by">
                            <issuelink>
            <issuekey id="11851">MODM-66</issuekey>
        </issuelink>
                    </inwardlinks>
                            </issuelinktype>
                    </issuelinks>
                <attachments>
                    <attachment id="10777" name="MODM70Test.php" size="2189" author="tecbot" created="Mon, 6 Sep 2010 14:36:40 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-69] implement commands to generate documents</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-69</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description></description>
                <environment></environment>
            <key id="11861">MODM-69</key>
            <summary>implement commands to generate documents</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="avalanche123">Bulat Shakirzyanov</assignee>
                                <reporter username="avalanche123">Bulat Shakirzyanov</reporter>
                        <labels>
                    </labels>
                <created>Tue, 31 Aug 2010 19:16:45 +0000</created>
                <updated>Sat, 12 Feb 2011 11:56:10 +0000</updated>
                    <resolved>Sat, 12 Feb 2011 11:56:11 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                <version>1.0.0ALPHA2</version>
                <version>1.0.0BETA1</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                        <due>Mon, 6 Sep 2010 00:00:00 +0000</due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15281" author="jwage" created="Sat, 12 Feb 2011 11:56:10 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/doctrine/mongodb-odm/commit/e2b7c35d9baa8444c62348c4132dc6bbb276114d&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/mongodb-odm/commit/e2b7c35d9baa8444c62348c4132dc6bbb276114d&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-68] port EntityGenerator to DocumentGenerator </title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-68</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description></description>
                <environment></environment>
            <key id="11860">MODM-68</key>
            <summary>port EntityGenerator to DocumentGenerator </summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="avalanche123">Bulat Shakirzyanov</reporter>
                        <labels>
                    </labels>
                <created>Tue, 31 Aug 2010 19:16:07 +0000</created>
                <updated>Sat, 12 Feb 2011 11:56:26 +0000</updated>
                    <resolved>Sat, 12 Feb 2011 11:56:26 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                <version>1.0.0ALPHA2</version>
                <version>1.0.0BETA1</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                        <due>Mon, 6 Sep 2010 00:00:00 +0000</due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15282" author="jwage" created="Sat, 12 Feb 2011 11:56:26 +0000"  >&lt;p&gt;Fixed here &lt;a href=&quot;https://github.com/doctrine/mongodb-odm/commit/e2b7c35d9baa8444c62348c4132dc6bbb276114d&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/mongodb-odm/commit/e2b7c35d9baa8444c62348c4132dc6bbb276114d&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-66] Bug when persisting referenced collection</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-66</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;After adding new entry to referenced collection of existing document, ODM generates invalid update query.&lt;/p&gt;

&lt;p&gt;Here is a test case:&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;
/** @Document(db=&lt;span class=&quot;code-quote&quot;&gt;&quot;tests&quot;&lt;/span&gt;, collection=&lt;span class=&quot;code-quote&quot;&gt;&quot;tests&quot;&lt;/span&gt;) */
class a
{
    /** @Id */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;

    /** @ReferenceMany(targetDocument=&lt;span class=&quot;code-quote&quot;&gt;&quot;b&quot;&lt;/span&gt;, cascade=&lt;span class=&quot;code-quote&quot;&gt;&quot;all&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $b;

    function __construct($b) {$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;b = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection($b);}

    function getB() {&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;b;}
}

/** @Document(db=&lt;span class=&quot;code-quote&quot;&gt;&quot;tests&quot;&lt;/span&gt;, collection=&lt;span class=&quot;code-quote&quot;&gt;&quot;tests2&quot;&lt;/span&gt;) */
class b
{
    /** @Id */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;

    /** @&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $tmp;

    function __construct($v) {$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;tmp = $v;}
}

$a = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; a(array(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; b(&apos;first&apos;)));
$dm-&amp;gt;persist($a);
$dm-&amp;gt;flush(); &lt;span class=&quot;code-comment&quot;&gt;// flush causes notices
&lt;/span&gt;$dm-&amp;gt;refresh($a);

$a-&amp;gt;getB()-&amp;gt;add(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; b(&apos;second&apos;));
$dm-&amp;gt;persist($a);
$dm-&amp;gt;flush();
$dm-&amp;gt;refresh($a);

print_r($a-&amp;gt;getB()-&amp;gt;toArray());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Expecting following output:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;Array
(
    [0] =&amp;gt; b Object
        (
            [id:protected] =&amp;gt; 4c7c9eea0f9d502005000000
            [tmp:protected] =&amp;gt; first
        )

    [1] =&amp;gt; b Object
        (
            [id:protected] =&amp;gt; 4c7c9eea0f9d502005020000
            [tmp:protected] =&amp;gt; second
        )

)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But getting:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;Array
(
    [0] =&amp;gt; b Object
        (
            [id:protected] =&amp;gt; 4c7c9eea0f9d502005000000
            [tmp:protected] =&amp;gt; first
        )

    [1] =&amp;gt; b Object
        (
            [id:protected] =&amp;gt; 4c7c9eea0f9d502005000000
            [tmp:protected] =&amp;gt; first
        )

    [2] =&amp;gt; b Object
        (
            [id:protected] =&amp;gt; 4c7c9eea0f9d502005020000
            [tmp:protected] =&amp;gt; second
        )

)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
</description>
                <environment></environment>
            <key id="11851">MODM-66</key>
            <summary>Bug when persisting referenced collection</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="avalanche123">Bulat Shakirzyanov</assignee>
                                <reporter username="vladar">Vladimir Razuvaev</reporter>
                        <labels>
                    </labels>
                <created>Tue, 31 Aug 2010 02:22:13 +0000</created>
                <updated>Mon, 6 Sep 2010 14:37:32 +0000</updated>
                    <resolved>Mon, 6 Sep 2010 12:26:21 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Persister</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14261" author="avalanche123" created="Fri, 3 Sep 2010 12:43:49 +0000"  >&lt;p&gt;here is a test case for it &lt;a href=&quot;http://pastie.org/1136303&quot; class=&quot;external-link&quot;&gt;http://pastie.org/1136303&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14264" author="avalanche123" created="Fri, 3 Sep 2010 13:28:27 +0000"  >&lt;p&gt;Jon, fixed here &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/tree/MODM-66&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/tree/MODM-66&lt;/a&gt;&lt;br/&gt;
Please review and resolve jira if everything is ok&lt;br/&gt;
As soon as the jira is resolved, I&apos;ll merge it in master&lt;/p&gt;</comment>
                    <comment id="14265" author="tecbot" created="Fri, 3 Sep 2010 14:38:00 +0000"  >&lt;p&gt;Error is not resolved!&lt;br/&gt;
Wrong test case. Test case should properly be so.&lt;br/&gt;
are dm-&amp;gt;refresh before the next flush. For there do it again a double entry!&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;$b1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; B(&apos;first&apos;);
$a = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; A(array($b1));
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;persist($a);
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;flush();
$b2 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; B(&apos;second&apos;);

$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;refresh($a); &lt;span class=&quot;code-comment&quot;&gt;// !!!!!!!!
&lt;/span&gt;
$a-&amp;gt;getB()-&amp;gt;add($b2);
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;flush(); &lt;span class=&quot;code-comment&quot;&gt;// He now adds the initial values there too. Thus, the array first, first and second!
&lt;/span&gt;
&lt;span class=&quot;code-comment&quot;&gt;// $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;refresh($a);
&lt;/span&gt;$b = $a-&amp;gt;getB()-&amp;gt;toArray();

$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEquals(2, count($b));

$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertEquals(array(
	$b1-&amp;gt;getId(), $b2-&amp;gt;getId()
), array(
	$b[0]-&amp;gt;getId(), $b[1]-&amp;gt;getId()
));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14266" author="avalanche123" created="Fri, 3 Sep 2010 14:41:27 +0000"  >&lt;p&gt;looking into it&lt;/p&gt;</comment>
                    <comment id="14267" author="avalanche123" created="Fri, 3 Sep 2010 16:49:05 +0000"  >&lt;p&gt;should be fixed here &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commits/MODM-66&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commits/MODM-66&lt;/a&gt;, please test and provide feedback&lt;/p&gt;</comment>
                    <comment id="14268" author="tecbot" created="Fri, 3 Sep 2010 18:11:03 +0000"  >&lt;p&gt;So the test is working now.&lt;/p&gt;

&lt;p&gt;But in my documents the problem persists!&lt;br/&gt;
Here is my test document:&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;namespace Documents\Avatar;

/**
 * @Document(collection=&lt;span class=&quot;code-quote&quot;&gt;&quot;avatars&quot;&lt;/span&gt;)
 */
class Avatar {

	/**
	 * @Id
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_id;
	/**
	 * @&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;na&quot;&lt;/span&gt;)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_name;
	/**
	 * @&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;sex&quot;&lt;/span&gt;)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_sex;
	/**
	 * @EmbedMany(
	 *	targetDocument=&lt;span class=&quot;code-quote&quot;&gt;&quot;Documents\Avatar\AvatarPartTest&quot;&lt;/span&gt;,
	 *	name=&lt;span class=&quot;code-quote&quot;&gt;&quot;aP&quot;&lt;/span&gt;
	 * )
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; array Documents\Avatar\AvatarPartTest
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_avatarParts;

	/**
	 * Constructor
	 * @param string $name
	 * @param &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; $sex
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct($name, $sex, $avatarParts = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_name = $name;
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sex = $sex;
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_avatarParts = $avatarParts;
	}

	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; string
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getId() {
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_id;
	}

	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; string
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getName() {
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_name;
	}

	/**
	 * @param string $name
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setName($name) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_name = $name;
	}

	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getSex() {
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sex;
	}

	/**
	 * @param &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; $sex
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setSex($sex) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sex = $sex;
	}

	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; array Documents\Avatar\AvatarPartTest
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getAvatarParts() {
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_avatarParts;
	}

	/**
	 * @param Documents\Avatar\AvatarPartTest $part
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function addAvatarPart($part) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_avatarParts[] = $part;
	}

	/**
	 * @param array Documents\Avatar\AvatarPartTest $parts
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setAvatarParts($parts) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_avatarParts = $parts;
	}

	/**
	 * @param Documents\Avatar\AvatarPartTest $part
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function removeAvatarPart($part) {
		$key = array_search($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_avatarParts, $part);
		&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($key !== &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;) {
			unset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_avatarParts[$key]);
		}
	}

}

namespace Documents\Avatar;

/**
 * @EmbeddedDocument
 */
class AvatarPartTest {
	/**
	 * @&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;col&quot;&lt;/span&gt;)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_color;

	/**
	 * Constructor
	 * @param string $type
	 * @param string $color
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __construct($color = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_color = $color;
	}

	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; string
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getColor() {
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_color;
	}

	/**
	 * @param string $color
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setColor($color) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_color = $color;
	}

}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And here is my test code:&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;$part = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Documents\Avatar\AvatarPartTest();
$avatar = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Documents\Avatar\Avatar(&apos;Test&apos;, 1, array($part));
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;persist($avatar);
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;flush();
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;refresh($avatar);

$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;getUnitOfWork()-&amp;gt;computeChangeSets();
$update = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;getUnitOfWork()-&amp;gt;getDocumentPersister(&apos;Documents\Avatar\Avatar&apos;)-&amp;gt;prepareUpdateData($avatar);
print_r($update);
&lt;span class=&quot;code-comment&quot;&gt;// print :
&lt;/span&gt;Array
(
    [$set] =&amp;gt; Array
        (
            [na] =&amp;gt; Test
            [sex] =&amp;gt; 1
        )
    [$pushAll] =&amp;gt; Array
        (
            [aP] =&amp;gt; Array
                (
                    [0] =&amp;gt; Array
                        (
                        )
                )
        )
)
&lt;span class=&quot;code-comment&quot;&gt;// That is wrong because it priced the initial values are!
&lt;/span&gt;
$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And this is the log:&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-comment&quot;&gt;// First insert
&lt;/span&gt;Array
(
    [batchInsert] =&amp;gt; 1
    [num] =&amp;gt; 1
    [data] =&amp;gt; Array
        (
            [0000000061fd6eaa00000000066fdfcd] =&amp;gt; Array
                (
                    [na] =&amp;gt; Test
                    [sex] =&amp;gt; 1
                    [aP] =&amp;gt; Array
                        (
                            [0] =&amp;gt; Array
                                (
                                )
                        )
                )
        )
    [class] =&amp;gt; Documents\Avatar\Avatar
    [db] =&amp;gt;test
    [collection] =&amp;gt; avatars
)

&lt;span class=&quot;code-comment&quot;&gt;// Refresh findOne
&lt;/span&gt;
&lt;span class=&quot;code-comment&quot;&gt;// The last flush after refresh
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// I have made no updates yet he wants to save the entire document again!
&lt;/span&gt;
Array
(
    [update] =&amp;gt; 1
    [criteria] =&amp;gt; Array
        (
            [_id] =&amp;gt; MongoId &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;
                (
                )
        )
    [newObj] =&amp;gt; Array
        (
            [$set] =&amp;gt; Array
                (
                    [na] =&amp;gt; Test
                    [sex] =&amp;gt; 1
                )
        )
    [options] =&amp;gt; Array
        (
        )
    [class] =&amp;gt; Documents\Avatar\Avatar
    [db] =&amp;gt; test
    [collection] =&amp;gt; avatars
)

Array
(
    [update] =&amp;gt; 1
    [criteria] =&amp;gt; Array
        (
            [_id] =&amp;gt; MongoId &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;
                (
                )
        )
    [newObj] =&amp;gt; Array
        (
            [$pushAll] =&amp;gt; Array
                (
                    [aP] =&amp;gt; Array
                        (
                            [0] =&amp;gt; Array
                                (
                                )
                        )
                )
        )
    [options] =&amp;gt; Array
        (
        )
    [class] =&amp;gt; Documents\Avatar\Avatar
    [db] =&amp;gt; test
    [collection] =&amp;gt; avatars
)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14270" author="vladar" created="Sat, 4 Sep 2010 02:37:03 +0000"  >&lt;p&gt;Still getting same error with example from original post (after odm update).&lt;/p&gt;</comment>
                    <comment id="14280" author="avalanche123" created="Sun, 5 Sep 2010 13:47:47 +0000"  >&lt;p&gt;The fix was in the &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/MODM-66&quot; title=&quot;Bug when persisting referenced collection&quot;&gt;&lt;del&gt;MODM-66&lt;/del&gt;&lt;/a&gt; branch, it is merged now into master, please re-try and confirm you are still getting an error&lt;/p&gt;</comment>
                    <comment id="14282" author="vladar" created="Sun, 5 Sep 2010 23:32:45 +0000"  >&lt;p&gt;Yes, it is fixed now. Thanks a lot!&lt;/p&gt;</comment>
                    <comment id="14283" author="tecbot" created="Mon, 6 Sep 2010 02:28:10 +0000"  >&lt;p&gt;The upper test works, but not my test!&lt;br/&gt;
Please test my written test earlier in a comment. Test documents are part of it!&lt;/p&gt;

&lt;p&gt;And:&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;dm-&amp;gt;getUnitOfWork()-&amp;gt;computeChangeSets();
$update = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;getUnitOfWork()-&amp;gt;getDocumentPersister(&apos;Documents\Avatar\Avatar&apos;)-&amp;gt;prepareUpdateData($avatar);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;still shows all the variables in it are already in Mongo!&lt;br/&gt;
According to flush all variables reset or push out!&lt;/p&gt;</comment>
                    <comment id="14287" author="avalanche123" created="Mon, 6 Sep 2010 12:26:21 +0000"  >&lt;p&gt;resolved&lt;/p&gt;</comment>
                    <comment id="14288" author="tecbot" created="Mon, 6 Sep 2010 12:59:15 +0000"  >&lt;p&gt;So I recorded all the updates, but my test document still does not work. The test for&lt;br/&gt;
this ticket is working, but not the test of my comment. Did they not make the mistake that he is a&lt;br/&gt;
push with initial values and sets makes name and gender again? Please give me an answer.&lt;br/&gt;
With this error is useless for me odm, because I can save anything, because everything in there twice&lt;br/&gt;
stands. There are also variables Increments etc.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;emoticon&quot; src=&quot;http://www.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;/p&gt;</comment>
                    <comment id="14289" author="avalanche123" created="Mon, 6 Sep 2010 13:57:35 +0000"  >&lt;p&gt;Thomas, the &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/MODM-70&quot; title=&quot;Updates of documents after read&quot;&gt;&lt;del&gt;MODM-70&lt;/del&gt;&lt;/a&gt; ticket is still open&lt;br/&gt;
Jon, can you please remove related to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/MODM-70&quot; title=&quot;Updates of documents after read&quot;&gt;&lt;del&gt;MODM-70&lt;/del&gt;&lt;/a&gt;, so that we don&apos;t confuse Thomas.&lt;br/&gt;
I am working on that ticket.&lt;/p&gt;</comment>
                    <comment id="14290" author="avalanche123" created="Mon, 6 Sep 2010 13:58:10 +0000"  >&lt;p&gt;Thomas, it would help me very much if you created a phpunit test case that fails.&lt;/p&gt;</comment>
                    <comment id="14293" author="tecbot" created="Mon, 6 Sep 2010 14:37:19 +0000"  >&lt;p&gt;Ok. I added a PHPUnit test case in &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/MODM-70&quot; title=&quot;Updates of documents after read&quot;&gt;&lt;del&gt;MODM-70&lt;/del&gt;&lt;/a&gt;.&lt;br/&gt;
I hope this helps. &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.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;</comment>
                </comments>
                <issuelinks>
                        <issuelinktype id="10000">
                <name>Duplicate</name>
                                <outwardlinks description="duplicates">
                            <issuelink>
            <issuekey id="11870">MODM-70</issuekey>
        </issuelink>
                    </outwardlinks>
                                            </issuelinktype>
                    </issuelinks>
                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-65] EmbeddedDocument - Incorrect assignment of special field names on save</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-65</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;If I have a document which has a  EmbeddedDocument and this other name used as the variable name. Thus, when saving but not used by the special reserved name of the variable name. But when read out of the special reserved name is used. so is my EmbeddedDocument always empty when the specific name are different. Furthermore, when I set no specific name for it is also EmbeddedDocument empty.&lt;/p&gt;

&lt;p&gt;Example:&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;/**
 * @EmbeddedDocument
 */
class SocialNetworkUser {
	/**
	 * @Int(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
	/**
	 * @&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;fN&quot;&lt;/span&gt;)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $firstName;
	/**
	 * @&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;lN&quot;&lt;/span&gt;)
	 * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; string
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $lastName;
}

/**
 * @Document(collection=&lt;span class=&quot;code-quote&quot;&gt;&quot;users&quot;&lt;/span&gt;)
 */
class User {
	/**
	 * @Id
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
	/**
	 * @EmbedOne(
	 * 	discriminatorField=&lt;span class=&quot;code-quote&quot;&gt;&quot;php&quot;&lt;/span&gt;,
	 * 	discriminatorMap={
	 * 		&lt;span class=&quot;code-quote&quot;&gt;&quot;fbu&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;Documents\SocialNetworkUser &quot;&lt;/span&gt;
	 * 	},
	 * 	name=&lt;span class=&quot;code-quote&quot;&gt;&quot;snu&quot;&lt;/span&gt;,
	 * 	cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;persist&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;remove&quot;&lt;/span&gt;}
	 * )
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $socialNetworkUser;
}

$user = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;findOne(&apos;Documents\User&apos;, array(&apos;snu.id&apos; =&amp;gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;Facebook-&amp;gt;getUser()));

print_r($user-&amp;gt;getSocialNetworkUser()):

Documents\SocialNetworkUser  &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;
(
    [id:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;] =&amp;gt; &lt;span class=&quot;code-comment&quot;&gt;// Commented
&lt;/span&gt;    [firstName:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;] =&amp;gt; 
    [lastName:&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt;] =&amp;gt; 
)

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;in Mongo:&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;Array
(
    [_id] =&amp;gt; 4c7b4fc3ed1590814d050000
    [snu] =&amp;gt; Array
        (
            [id] =&amp;gt; &lt;span class=&quot;code-comment&quot;&gt;// Commented
&lt;/span&gt;            [firstName] =&amp;gt; Thomas
            [lastName] =&amp;gt; Adam
            [php] =&amp;gt; fbu
        )
)

Correct but should be:

Array
(
    [_id] =&amp;gt; 4c7b4fc3ed1590814d050000
    [snu] =&amp;gt; Array
        (
            [id] =&amp;gt; &lt;span class=&quot;code-comment&quot;&gt;// Commented
&lt;/span&gt;            [fN] =&amp;gt; Thomas
            [lN] =&amp;gt; Adam
            [php] =&amp;gt; fbu
        )
)

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11847">MODM-65</key>
            <summary>EmbeddedDocument - Incorrect assignment of special field names on save</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="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="tecbot">Thomas Adam</reporter>
                        <labels>
                    </labels>
                <created>Mon, 30 Aug 2010 03:38:38 +0000</created>
                <updated>Mon, 30 Aug 2010 14:40:05 +0000</updated>
                    <resolved>Mon, 30 Aug 2010 14:40:05 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14162" author="jwage" created="Mon, 30 Aug 2010 10:20:38 +0000"  >&lt;p&gt;So, basically the name attribute is not being used on embedded documents?&lt;/p&gt;</comment>
                    <comment id="14164" author="tecbot" created="Mon, 30 Aug 2010 10:53:31 +0000"  >&lt;p&gt;Correct. But when read out of data it is used the name attribute.&lt;/p&gt;</comment>
                    <comment id="14168" author="jwage" created="Mon, 30 Aug 2010 14:39:51 +0000"  >&lt;p&gt;Fixed here &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/3331a91fc628cc2196bcbdc4bbed91d6faa743d3&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/3331a91fc628cc2196bcbdc4bbed91d6faa743d3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks, Jon&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-63] More errors when persisting gridfs files</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-63</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Getting following errors when trying to persist GridFS file.&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;Trying to get property of non-object in file Doctrine\ODM\MongoDB\MongoCollection.php on line 196 
Undefined index: _id in file Doctrine\ODM\MongoDB\Persisters\BasicDocumentPersister.php on line 163 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Unfortunately couldn&apos;t create reproducable test-case yet, but if that is not an obvious issue, please let me know, I&apos;ll try to dig deeper and get the test case.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11842">MODM-63</key>
            <summary>More errors when persisting gridfs files</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vladar">Vladimir Razuvaev</reporter>
                        <labels>
                    </labels>
                <created>Sat, 28 Aug 2010 05:38:38 +0000</created>
                <updated>Wed, 24 Nov 2010 14:37:24 +0000</updated>
                    <resolved>Wed, 24 Nov 2010 14:37:09 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Persister</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14169" author="jwage" created="Mon, 30 Aug 2010 14:41:37 +0000"  >&lt;p&gt;We&apos;ll need a test case, always. Or atleast some kind of pasted code that I can use to produce the issue.&lt;/p&gt;</comment>
                    <comment id="14173" author="jwage" created="Mon, 30 Aug 2010 15:30:41 +0000"  >&lt;p&gt;Can you just paste the code that causes the error? Like you have done in previous issues. I can&apos;t seem to replicate this one.&lt;/p&gt;</comment>
                    <comment id="14186" author="vladar" created="Tue, 31 Aug 2010 02:29:04 +0000"  >&lt;p&gt;I&apos;ve found a case when it happens. It is an exceptional situation when someone is trying to persist file without property $file being set.&lt;/p&gt;

&lt;p&gt;E.g. the case:&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;/** @Document(db=&lt;span class=&quot;code-quote&quot;&gt;&quot;tests&quot;&lt;/span&gt;, collection=&lt;span class=&quot;code-quote&quot;&gt;&quot;fs&quot;&lt;/span&gt;) */
class a
{
    /** @Id */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;

    /** @File */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $file; &lt;span class=&quot;code-comment&quot;&gt;// note, file is not set
&lt;/span&gt;
    /** @&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $c = &apos;tmp&apos;;
}

$a = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; a();
$dm-&amp;gt;persist($a);
$dm-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This test case produces notices and warnings. My guess is that it should end up with Exception?&lt;/p&gt;</comment>
                    <comment id="14824" author="jwage" created="Wed, 24 Nov 2010 14:37:09 +0000"  >&lt;p&gt;This should be fixed now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-62] PHP warning when array is replaced with ArrayCollection: array_udiff_assoc(): Argument #2 is not an array</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-62</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Simple test case to reproduce:&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;/** @Document(db=&lt;span class=&quot;code-quote&quot;&gt;&quot;tests&quot;&lt;/span&gt;, collection=&lt;span class=&quot;code-quote&quot;&gt;&quot;tests&quot;&lt;/span&gt;) */
class a {
    /** @Id */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;

    /** @Collection */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $b = array(&apos;test&apos;);

    function setB($b) {$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;b = $b;}
}

$a = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; a();
$dm-&amp;gt;persist($a);
$dm-&amp;gt;flush();
$dm-&amp;gt;refresh($a);

$a-&amp;gt;setB(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection(array(&apos;test&apos;)));
$dm-&amp;gt;persist($a);
$dm-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Getting PHP warning:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;PHP Warning:  array_udiff_assoc(): Argument #2 is not an array in Doctrine\ODM\MongoDB\Persisters\BasicDocumentPersister.php on line 458
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11841">MODM-62</key>
            <summary>PHP warning when array is replaced with ArrayCollection: array_udiff_assoc(): Argument #2 is not an array</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vladar">Vladimir Razuvaev</reporter>
                        <labels>
                    </labels>
                <created>Sat, 28 Aug 2010 05:10:43 +0000</created>
                <updated>Mon, 30 Aug 2010 15:10:44 +0000</updated>
                    <resolved>Mon, 30 Aug 2010 15:10:44 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Persister</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14170" author="jwage" created="Mon, 30 Aug 2010 15:10:44 +0000"  >&lt;p&gt;Thanks, fixed in &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/c12c9239cf152b4764da07b2bc89bfc6967a9569&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/c12c9239cf152b4764da07b2bc89bfc6967a9569&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-61] GridFs file is stored incorrectly after two flushes</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-61</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;GridFs file is stored incorrectly after two flushes.&lt;/p&gt;

&lt;p&gt;Consider an example:&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;/** @Document(db=&lt;span class=&quot;code-quote&quot;&gt;&quot;tests&quot;&lt;/span&gt;, collection=&lt;span class=&quot;code-quote&quot;&gt;&quot;fs&quot;&lt;/span&gt;) */
class File
{
    /** @Id */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;

    /** @File */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $file;

    function  __construct($source) {$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;file = $source;}
}

$file = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; File(__DIR__ . &apos;/test.txt&apos;);

$dm-&amp;gt;persist($file);
$dm-&amp;gt;flush();
$dm-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After second flush, doctrine will also store &quot;file&quot; property as if it was a regular object. Expecting:&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-quote&quot;&gt;&quot;_id&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;4c777fc00f9d505407020000&quot;&lt;/span&gt;,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;filename&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;/test.txt&quot;&lt;/span&gt;,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;uploadDate&quot;&lt;/span&gt;: {
    &lt;span class=&quot;code-quote&quot;&gt;&quot;sec&quot;&lt;/span&gt;: 1282899904,
    &lt;span class=&quot;code-quote&quot;&gt;&quot;usec&quot;&lt;/span&gt;: 0
  },
  &lt;span class=&quot;code-quote&quot;&gt;&quot;length&quot;&lt;/span&gt;: 10,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;chunkSize&quot;&lt;/span&gt;: 262144,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;md5&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;76ce9f441de2ed5de337d391ad4516b7&quot;&lt;/span&gt;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Actual result:&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-quote&quot;&gt;&quot;_id&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;4c777f780f9d508416020000&quot;&lt;/span&gt;,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;chunkSize&quot;&lt;/span&gt;: 262144,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;file&quot;&lt;/span&gt;: {
    &lt;span class=&quot;code-quote&quot;&gt;&quot;file&quot;&lt;/span&gt;: {
      &lt;span class=&quot;code-quote&quot;&gt;&quot;_id&quot;&lt;/span&gt;: {},
      &lt;span class=&quot;code-quote&quot;&gt;&quot;filename&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;/test.txt&quot;&lt;/span&gt;,
      &lt;span class=&quot;code-quote&quot;&gt;&quot;uploadDate&quot;&lt;/span&gt;: {
        &lt;span class=&quot;code-quote&quot;&gt;&quot;sec&quot;&lt;/span&gt;: 1282899832,
        &lt;span class=&quot;code-quote&quot;&gt;&quot;usec&quot;&lt;/span&gt;: 0
      },
      &lt;span class=&quot;code-quote&quot;&gt;&quot;length&quot;&lt;/span&gt;: 10,
      &lt;span class=&quot;code-quote&quot;&gt;&quot;chunkSize&quot;&lt;/span&gt;: 262144,
      &lt;span class=&quot;code-quote&quot;&gt;&quot;md5&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;76ce9f441de2ed5de337d391ad4516b7&quot;&lt;/span&gt;
    },
    &quot;&quot;: {
      &lt;span class=&quot;code-quote&quot;&gt;&quot;w&quot;&lt;/span&gt;: 1,
      &lt;span class=&quot;code-quote&quot;&gt;&quot;wtimeout&quot;&lt;/span&gt;: 10000,
      &lt;span class=&quot;code-quote&quot;&gt;&quot;chunks&quot;&lt;/span&gt;: {
        &lt;span class=&quot;code-quote&quot;&gt;&quot;w&quot;&lt;/span&gt;: 1,
        &lt;span class=&quot;code-quote&quot;&gt;&quot;wtimeout&quot;&lt;/span&gt;: 10000
      },
      &lt;span class=&quot;code-quote&quot;&gt;&quot;&quot;: &quot;&lt;/span&gt;fs.chunks&quot;
    }
  },
  &lt;span class=&quot;code-quote&quot;&gt;&quot;filename&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;/test.txt&quot;&lt;/span&gt;,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;length&quot;&lt;/span&gt;: 10,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;md5&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;76ce9f441de2ed5de337d391ad4516b7&quot;&lt;/span&gt;,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;uploadDate&quot;&lt;/span&gt;: {
    &lt;span class=&quot;code-quote&quot;&gt;&quot;sec&quot;&lt;/span&gt;: 1282899832,
    &lt;span class=&quot;code-quote&quot;&gt;&quot;usec&quot;&lt;/span&gt;: 0
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;P.S. Unfortunately cannot use PHPUnit 3.5 right now to provide unit test.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11834">MODM-61</key>
            <summary>GridFs file is stored incorrectly after two flushes</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vladar">Vladimir Razuvaev</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 Aug 2010 05:11:43 +0000</created>
                <updated>Mon, 30 Aug 2010 15:30:05 +0000</updated>
                    <resolved>Mon, 30 Aug 2010 15:30:05 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Persister</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14172" author="jwage" created="Mon, 30 Aug 2010 15:30:05 +0000"  >&lt;p&gt;Fixed by &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/e8945bc53b59e8c8b8c0b13df0b73a8774c7111b&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/e8945bc53b59e8c8b8c0b13df0b73a8774c7111b&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-59] Exception:  &quot;The given document has no identity.&quot; when findOne query returns none from a MongoGridFs</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-59</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;When running a query against a GridFS that should return no results, I expect the return value to be null (as with normal documents) instead an InvalidArgumentException is thrown, with the message &quot;The given document has no identity&quot;.&lt;/p&gt;

&lt;p&gt;It appears the empty result is trying to be registered as a managed document with the UOW, because MongoCollection does not return null in this case.&lt;/p&gt;
</description>
                <environment></environment>
            <key id="11824">MODM-59</key>
            <summary>Exception:  &quot;The given document has no identity.&quot; when findOne query returns none from a MongoGridFs</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="avalanche123">Bulat Shakirzyanov</assignee>
                                <reporter username="scottaubrey">Scott Aubrey</reporter>
                        <labels>
                    </labels>
                <created>Wed, 25 Aug 2010 11:44:33 +0000</created>
                <updated>Thu, 26 Aug 2010 10:53:10 +0000</updated>
                    <resolved>Thu, 26 Aug 2010 10:53:10 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Mongo, MongoCollection, MongoCursor</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14067" author="scottaubrey" created="Wed, 25 Aug 2010 11:55:55 +0000"  >&lt;p&gt;Issue fixed in my git hub branch&lt;/p&gt;

&lt;p&gt;scottaubrey / mongodb-odm @ &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/MODM-59&quot; title=&quot;Exception:  &amp;quot;The given document has no identity.&amp;quot; when findOne query returns none from a MongoGridFs&quot;&gt;&lt;del&gt;MODM-59&lt;/del&gt;&lt;/a&gt; &lt;br/&gt;
git@github.com:scottaubrey/mongodb-odm.git&lt;/p&gt;

&lt;p&gt;pull request sent&lt;/p&gt;

&lt;p&gt;(sorry not sure how much of this I&apos;m meant to mention here, my first contribution with git and github)&lt;/p&gt;</comment>
                    <comment id="14090" author="avalanche123" created="Thu, 26 Aug 2010 10:53:10 +0000"  >&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/e677f64004b9bc900bfc8f098b15eb24dc3d5262&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/e677f64004b9bc900bfc8f098b15eb24dc3d5262&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-58] Update Collection API</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-58</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;need to update to reflect this change &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DCOM-17&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DCOM-17&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="11820">MODM-58</key>
            <summary>Update Collection API</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="avalanche123">Bulat Shakirzyanov</assignee>
                                <reporter username="avalanche123">Bulat Shakirzyanov</reporter>
                        <labels>
                    </labels>
                <created>Tue, 24 Aug 2010 16:03:15 +0000</created>
                <updated>Fri, 27 Aug 2010 11:48:24 +0000</updated>
                    <resolved>Fri, 27 Aug 2010 11:48:24 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                <version>1.0.0ALPHA2</version>
                <version>1.0.0BETA1</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Collections</component>
                <component>Mongo, MongoCollection, MongoCursor</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14088" author="avalanche123" created="Thu, 26 Aug 2010 09:36:06 +0000"  >&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/e46ec823bb1b2b463f4931a0cadfe6c6bd39286d&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/e46ec823bb1b2b463f4931a0cadfe6c6bd39286d&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14096" author="avalanche123" created="Thu, 26 Aug 2010 14:19:23 +0000"  >&lt;p&gt;fix typo and add test &lt;/p&gt;</comment>
                    <comment id="14116" author="avalanche123" created="Fri, 27 Aug 2010 11:48:24 +0000"  >&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/298b72378d829c5b7010273981b23fb7f9882d89&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/298b72378d829c5b7010273981b23fb7f9882d89&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-57] The SchemaManager::createDocumentDB/createDatabases</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-57</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Make ShemaManager execute an arbitrary command on selected db, to trigger actual db creation in SchemaManager::createDocumentDB/createDatabases.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11817">MODM-57</key>
            <summary>The SchemaManager::createDocumentDB/createDatabases</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="avalanche123">Bulat Shakirzyanov</assignee>
                                <reporter username="avalanche123">Bulat Shakirzyanov</reporter>
                        <labels>
                    </labels>
                <created>Mon, 23 Aug 2010 18:48:05 +0000</created>
                <updated>Tue, 24 Aug 2010 10:31:43 +0000</updated>
                    <resolved>Tue, 24 Aug 2010 10:31:43 +0000</resolved>
                            <version>1.0.0BETA1</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14045" author="avalanche123" created="Tue, 24 Aug 2010 10:31:43 +0000"  >&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/87dfe45ac63818e5a274744bfb46abe63c4fb36d&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/87dfe45ac63818e5a274744bfb46abe63c4fb36d&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-56] @PreUpdate &amp; EmbedMany</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-56</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</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;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unable to find source-code formatter for language: php.&lt;/span&gt; Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml&lt;/div&gt;&lt;pre&gt;&lt;span class=&quot;code-comment&quot;&gt;// Article
&lt;/span&gt;namespace Bundle\ArticleBundle\Document;

use Bundle\CommentBundle\Document\Comment;
use Bundle\ExerciseCommonBundle\Document\Repository;

/**
 * @Document(
 *   collection=&lt;span class=&quot;code-quote&quot;&gt;&quot;article&quot;&lt;/span&gt;,
 *   indexes={
 *     @Index(keys={&lt;span class=&quot;code-quote&quot;&gt;&quot;createdAt&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;asc&quot;&lt;/span&gt;})
 *   },
 *   repositoryClass=&lt;span class=&quot;code-quote&quot;&gt;&quot;Bundle\ArticleBundle\Document\ArticleRepository&quot;&lt;/span&gt;
 * )
 * @HasLifecycleCallbacks
 */
class Article
{
    /**
     * @Id
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
    /**
     * @ReferenceOne(targetDocument=&lt;span class=&quot;code-quote&quot;&gt;&quot;Bundle\AccountBundle\Document\User&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $user;
    /**
     * @ReferenceOne(targetDocument=&lt;span class=&quot;code-quote&quot;&gt;&quot;Bundle\ArticleBundle\Document\ArticleCategory&quot;&lt;/span&gt;)
     * @Validation({
     *      @NotBlank (message=&lt;span class=&quot;code-quote&quot;&gt;&quot;Please select a category.&quot;&lt;/span&gt;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $category;
    /**
     * @Field(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $slug;
    /**
     * @Field(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
     * @Validation({
     *      @NotBlank (message=&lt;span class=&quot;code-quote&quot;&gt;&quot;You forgot a Title?&quot;&lt;/span&gt;),
     *      @MinLength(limit=4, message=&lt;span class=&quot;code-quote&quot;&gt;&quot;Just a little too &lt;span class=&quot;code-object&quot;&gt;short&lt;/span&gt;.&quot;&lt;/span&gt;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $title;
    /**
     * @Field(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
     * @Validation({
     *      @NotBlank (message=&lt;span class=&quot;code-quote&quot;&gt;&quot;Please summarize your article.&quot;&lt;/span&gt;),
     *      @MinLength(limit=100, message=&lt;span class=&quot;code-quote&quot;&gt;&quot;Not &lt;span class=&quot;code-object&quot;&gt;long&lt;/span&gt; enough!&quot;&lt;/span&gt;),
     *      @MaxLength(limit=200, message=&lt;span class=&quot;code-quote&quot;&gt;&quot;A wee bit too &lt;span class=&quot;code-object&quot;&gt;long&lt;/span&gt;.&quot;&lt;/span&gt;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $summary;
    /**
     * @Field(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;)
     * @Validation({
     *      @NotBlank (message=&lt;span class=&quot;code-quote&quot;&gt;&quot;Where&apos;s the beef?&quot;&lt;/span&gt;)
     * })
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $body;
    
	/** 
	 * @EmbedMany(targetDocument=&lt;span class=&quot;code-quote&quot;&gt;&quot;Bundle\CommentBundle\Document\Comment&quot;&lt;/span&gt;) 
	 * */
	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $comments = array();
	
    /**
     * @Field(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $published = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
    /**
     * @Field(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;date&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $createdAt;
    /**
     * @Field(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;date&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $updatedAt;

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getId()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;id;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function isNew() {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; empty($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;id);
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getUser()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;user;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getCategory()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;category;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getSlug()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;slug;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setSlug($slug)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;slug = $slug;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUniqueSlug()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;slug = Repository::Slugify($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;title);
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function isPublished()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;published) {
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
        }
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function publish()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;published = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function unpublish()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;published = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getSummary()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;summary;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setSummary($summary)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;summary = $summary;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getTitle()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;title;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTitle($title)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;title = $title;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getBody()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;body;
    }



    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setBody($body)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;body = $body;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUser($user) {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;user = $user;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setCategory($category) {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;category = $category;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getCreatedAt()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;createdAt;
    }

    /**
     * It can be useful when writing fixtures
     * @param \DateTime $date
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; void
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setCreatedAt(\DateTime $date)
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;createdAt = $date;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getUpdatedAt()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;updatedAt;
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function __toString()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;title();
    }
    
    
	/**
	 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; the $comments
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getComments() {
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;comments;
	}    
    
	/**
	 * @param $comments the $comments to set
	 */
	&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setComments($comments) {
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;comments = $comments;
	}
    /** @PrePersist */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function incrementCreatedAt()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;(&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; === $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;createdAt) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;createdAt = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \DateTime();
        }
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;updatedAt = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \DateTime();
    }

    /** @PreUpdate */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function incrementUpdatedAt() {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;updatedAt = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \DateTime();
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function fromArray(array $array)
    {
        foreach($array as $property =&amp;gt; $value) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;$property = $value;
        }
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unable to find source-code formatter for language: php.&lt;/span&gt; Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml&lt;/div&gt;&lt;pre&gt;&lt;span class=&quot;code-comment&quot;&gt;// Comment
&lt;/span&gt;&amp;lt;?php

namespace Bundle\CommentBundle\Document;

/**
 * @EmbeddedDocument
 */
class Comment
{
	
	/**
     * @Id
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
	
    /**
     * @Field(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;date&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $createdAt;

    /**
     * @Field(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, nullable=&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $message;

    /**
     * @ReferenceOne(targetDocument=&lt;span class=&quot;code-quote&quot;&gt;&quot;Bundle\AccountBundle\Document\User&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $user;

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; the $createdAt
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getCreatedAt() {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;createdAt;
    }

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; the $message
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getMessage() {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;message;
    }

    /**
     * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; the $user
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getUser() {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;user;
    }

    /**
     * @param $createdAt the $createdAt to set
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setCreatedAt($createdAt) {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;createdAt = $createdAt;
    }

&lt;span class=&quot;code-comment&quot;&gt;//    /** @PrePersist */
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;//    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function incrementCreatedAt()
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;//    {
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;//        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;(&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; === $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;createdAt) {
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;//            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;createdAt = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \DateTime();
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;//        }
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;//        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;updatedAt = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \DateTime();
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;//    }
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;//
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;//    /** @PreUpdate */
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;//    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function incrementUpdatedAt() {
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;//        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;updatedAt = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \DateTime();
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;//    }
&lt;/span&gt;
    /**
     * @param $message the $message to set
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setMessage($message) {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;message = $message;
    }

    /**
     * @param $by_user_id the $by_user_id to set
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUser($user) {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;user = $user;
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unable to find source-code formatter for language: php.&lt;/span&gt; Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml&lt;/div&gt;&lt;pre&gt;                $article = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;odm-&amp;gt;getRepository(&apos;Bundle\ArticleBundle\Document\Article&apos;)-&amp;gt;find(&lt;span class=&quot;code-quote&quot;&gt;&quot;someID&quot;&lt;/span&gt;);

		$newComment = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Comment();
		$newComment-&amp;gt;setUser($user);
		$newComment-&amp;gt;setMessage(&lt;span class=&quot;code-quote&quot;&gt;&quot;PPPPOOOOOPPPP&quot;&lt;/span&gt;);
		$newComment-&amp;gt;setCreatedAt(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \DateTime());
		
		$comments = $article-&amp;gt;getComments();
		$comments[] = $newComment;
		$article-&amp;gt;setComments($comments);
		
		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;odm-&amp;gt;persist($article);
                &lt;span class=&quot;code-comment&quot;&gt;// With or without the args to flush
&lt;/span&gt;		$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;odm-&amp;gt;flush(array(&apos;safe&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With the above - no exception or error is thrown.  It appears that the comment is added - but checking the collection in mongo and there&apos;s nothing added to the document.&lt;br/&gt;
Removing the PreUpdate on the Article method allows the embedded document to be saved into Article.&lt;/p&gt;</description>
                <environment>PHP 5.3.2+, Mongodb, recent (varies by developer but all experiencing the same issue)</environment>
            <key id="11811">MODM-56</key>
            <summary>@PreUpdate &amp; EmbedMany</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="dasher">D Ashwood</reporter>
                        <labels>
                    </labels>
                <created>Sun, 22 Aug 2010 09:06:41 +0000</created>
                <updated>Tue, 24 Aug 2010 11:38:03 +0000</updated>
                    <resolved>Tue, 24 Aug 2010 11:38:03 +0000</resolved>
                            <version>1.0.0ALPHA2</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Persister</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14032" author="jwage" created="Mon, 23 Aug 2010 12:59:46 +0000"  >&lt;p&gt;Hi, can you provide a consolidated PHPUnit test case?&lt;/p&gt;</comment>
                    <comment id="14036" author="dasher" created="Mon, 23 Aug 2010 16:05:24 +0000"  >&lt;p&gt;Just to clarify:&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;$parent = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ParentDocument();
$odm-&amp;gt;persist($parent);
$odm-&amp;gt;flush();

&lt;span class=&quot;code-comment&quot;&gt;// count(parent-&amp;gt;getChildren() ) = 0
&lt;/span&gt;
&lt;span class=&quot;code-comment&quot;&gt;// Add some children
&lt;/span&gt;$childOne = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; childEmbededDocument();

$children = $parent-&amp;gt;getChildren();
$children[] = $childOne;
$parent-&amp;gt;setChildren($children);
$odm-&amp;gt;persist($parent);

$childTwo = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; childEmbededDocument();

$children = $parent-&amp;gt;getChildren();
$children[] = $childTwo;
$parent-&amp;gt;setChildren($children);
$odm-&amp;gt;persist($parent);

&lt;span class=&quot;code-comment&quot;&gt;// Results
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// When $parent has lifeCycle callbacks - specifically @PreUpdate - count(parent-&amp;gt;getChildren() ) = 0
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// When $parent doesn&apos;t have lifeCycle callbacks - count(parent-&amp;gt;getChildren() ) = 2&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So the issue isn&apos;t so much about lifeCycle cascading to the children - it&apos;s that the parent lifeCycle callback @PreUpdate affects adding embedded children.&lt;/p&gt;</comment>
                    <comment id="14038" author="jwage" created="Mon, 23 Aug 2010 16:14:15 +0000"  >&lt;p&gt;I am still not clear on what the problem is &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; Jay said you were trying to use lifecycle callbacks on embedded documents which is not supported. You all seem to be talking about 2 different things?&lt;/p&gt;</comment>
                    <comment id="14039" author="jwage" created="Mon, 23 Aug 2010 17:20:58 +0000"  >&lt;p&gt;Fixed by &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/faf85a281b1562d184b44261a6e4dcdb13e03c5e&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/faf85a281b1562d184b44261a6e4dcdb13e03c5e&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14046" author="jwage" created="Tue, 24 Aug 2010 11:38:03 +0000"  >&lt;p&gt;The callbacks will also work on embedded documents now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-55] Extract SchemaManager from DocumentManager</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-55</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description></description>
                <environment></environment>
            <key id="11805">MODM-55</key>
            <summary>Extract SchemaManager from DocumentManager</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="avalanche123">Bulat Shakirzyanov</assignee>
                                <reporter username="avalanche123">Bulat Shakirzyanov</reporter>
                        <labels>
                    </labels>
                <created>Thu, 19 Aug 2010 14:47:02 +0000</created>
                <updated>Mon, 23 Aug 2010 11:02:56 +0000</updated>
                    <resolved>Mon, 23 Aug 2010 11:02:56 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Document Manager</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14029" author="avalanche123" created="Mon, 23 Aug 2010 11:02:56 +0000"  >&lt;p&gt;finished here &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/231dc888be3673658254aad3946e04440400b24c&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/231dc888be3673658254aad3946e04440400b24c&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-54] New console commands</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-54</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;We need to add commands for creating and dropping document databases and collections. I added methods to DocumentManager for creating/dropping databases and collections for documents. We have the command for creating indexes, now we need the same for databases and collections.&lt;/p&gt;

&lt;p&gt;The reason is because you can specify configuration for the collection in the mapping that is used on collection creation:&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;/** @Document(collection={&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;collname&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;capped&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&quot;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&quot;max&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;10&quot;&lt;/span&gt;}) */
class Document
{}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11804">MODM-54</key>
            <summary>New console commands</summary>
                <type id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/newfeature.png">New Feature</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="avalanche123">Bulat Shakirzyanov</assignee>
                                <reporter username="jwage">Jonathan H. Wage</reporter>
                        <labels>
                    </labels>
                <created>Thu, 19 Aug 2010 14:31:38 +0000</created>
                <updated>Tue, 24 Aug 2010 11:58:26 +0000</updated>
                    <resolved>Tue, 24 Aug 2010 11:58:26 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14040" author="avalanche123" created="Mon, 23 Aug 2010 18:03:22 +0000"  >&lt;p&gt;Jon, these are implemented here &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/tree/MODM-54&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/tree/MODM-54&lt;/a&gt;, please comment with suggestions, or else I&apos;ll merge it in, thanks&lt;/p&gt;</comment>
                    <comment id="14047" author="jwage" created="Tue, 24 Aug 2010 11:38:26 +0000"  >&lt;p&gt;Looks good. Once you implement the changes we discussed via jabber you can merge.&lt;/p&gt;</comment>
                    <comment id="14049" author="avalanche123" created="Tue, 24 Aug 2010 11:58:26 +0000"  >&lt;p&gt;done&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-52] Changes of nested embedded collection are not persisted</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-52</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;When there is a nested EmbedMany collection, changes of this collection are not persisted when saving root document.&lt;/p&gt;

&lt;p&gt;Maybe simpler to explain with a test case:&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;
/**
 * @MappedSuperClass
 */
class container
{
    /** @&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $tmp = &apos;ensureSaved&apos;;

    /** @EmbedMany(targetDocument=&lt;span class=&quot;code-quote&quot;&gt;&quot;emb&quot;&lt;/span&gt;, cascade=&lt;span class=&quot;code-quote&quot;&gt;&quot;all&quot;&lt;/span&gt;, strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;set&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $items = array();

    function __construct($items = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;($items) $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;items = $items;}
    function getItems() {&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;items;}
    function getItem($index) {&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;items[$index];}
    function removeItem($i) {unset($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;items[$i]);}
}

/** @EmbeddedDocument */
class emb &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; container
{}

/** @Document(db=&lt;span class=&quot;code-quote&quot;&gt;&quot;tests&quot;&lt;/span&gt;, collection=&lt;span class=&quot;code-quote&quot;&gt;&quot;tests&quot;&lt;/span&gt;) */
class doc &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; container
{
    /** @Id */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;
}

$emb = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; emb(array(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; emb(), &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; emb()));
$doc = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; doc(array($emb));

$dm-&amp;gt;persist($doc);
$dm-&amp;gt;flush();
$dm-&amp;gt;refresh($doc);

&lt;span class=&quot;code-comment&quot;&gt;// change nested embedded collection:
&lt;/span&gt;$doc-&amp;gt;getItem(0)-&amp;gt;removeItem(1);
$before = count($doc-&amp;gt;getItem(0)-&amp;gt;getItems());

$dm-&amp;gt;persist($doc);
$dm-&amp;gt;flush();
$dm-&amp;gt;refresh($doc);

$after = count($doc-&amp;gt;getItem(0)-&amp;gt;getItems());
var_dump($before); &lt;span class=&quot;code-comment&quot;&gt;// outputs 1
&lt;/span&gt;var_dump($after);  &lt;span class=&quot;code-comment&quot;&gt;// outputs 2, but expecting 1&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11790">MODM-52</key>
            <summary>Changes of nested embedded collection are not persisted</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vladar">Vladimir Razuvaev</reporter>
                        <labels>
                    </labels>
                <created>Wed, 18 Aug 2010 04:14:24 +0000</created>
                <updated>Wed, 18 Aug 2010 13:14:24 +0000</updated>
                    <resolved>Wed, 18 Aug 2010 13:14:12 +0000</resolved>
                            <version>1.0.0BETA1</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Persister</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13994" author="vladar" created="Wed, 18 Aug 2010 04:27:48 +0000"  >&lt;p&gt;I think it might be related to &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/MODM-29?focusedCommentId=13972&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_13972&quot; class=&quot;external-link&quot;&gt;this comment&lt;/a&gt;, although not sure.&lt;/p&gt;</comment>
                    <comment id="14006" author="jwage" created="Wed, 18 Aug 2010 13:14:12 +0000"  >&lt;p&gt;Thanks for the issue and test!&lt;/p&gt;

&lt;p&gt;Fixed here &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/3e71c6a6f99360d88c66043ff989d7671e2ded08&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/3e71c6a6f99360d88c66043ff989d7671e2ded08&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-51] Strange issue with @File annotation</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-51</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Not sure if it is ODM issue or some PHP Reflection issue, or I just don&apos;t getting something, but following test case won&apos;t save the file:&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;/** @Document(db=&lt;span class=&quot;code-quote&quot;&gt;&quot;tests&quot;&lt;/span&gt;, collection=&lt;span class=&quot;code-quote&quot;&gt;&quot;files&quot;&lt;/span&gt;) */
class file
{
    /** @Id */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;

    /**
     * @File
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; \MongoGridFSFile
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $file;

    function __construct($file) {$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;file = $file;}
}

$f = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; file(__DIR__  . &apos;/test.txt&apos;);
$dm-&amp;gt;persist($f);
$dm-&amp;gt;flush();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The problem is in annotation @var \MongoGridFSFile. Without it file is saved properly. Also, if I remove &quot;\&quot; in front of MongoGridFSFile, file will be also saved properly. Weird thing.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11789">MODM-51</key>
            <summary>Strange issue with @File annotation</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vladar">Vladimir Razuvaev</reporter>
                        <labels>
                    </labels>
                <created>Wed, 18 Aug 2010 00:08:49 +0000</created>
                <updated>Wed, 18 Aug 2010 21:52:43 +0000</updated>
                    <resolved>Wed, 18 Aug 2010 21:52:43 +0000</resolved>
                                            <fixVersion>1.0.0BETA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13993" author="jwage" created="Wed, 18 Aug 2010 00:52:55 +0000"  >&lt;p&gt;I think this is a problem with the annotations parser and nothing with the ODM.&lt;/p&gt;</comment>
                    <comment id="14011" author="jwage" created="Wed, 18 Aug 2010 21:52:43 +0000"  >&lt;p&gt;This was an issue with Doctrine Common. I committed a fix for it.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-29] Persisting changes ordering of elements in embedded collection in some cases</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-29</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;After changing ordering of elements in collection, it is persisted incorrectly (with different ordering than expected).&lt;/p&gt;

&lt;p&gt;Here is a test case:&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;/** @Document(collection=&lt;span class=&quot;code-quote&quot;&gt;&quot;tests&quot;&lt;/span&gt;, db=&lt;span class=&quot;code-quote&quot;&gt;&quot;tests&quot;&lt;/span&gt;) */
class doc
{
    /** @Id */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;

    /** @EmbedMany(targetDocument=&lt;span class=&quot;code-quote&quot;&gt;&quot;emb&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $collection;

    function __construct($c) {$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;set($c);}

    function set($c) {$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;collection = $c;}
    function get() {&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;collection;}
}

/** @EmbeddedDocument */
class emb
{
    /** @&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $val;

    function __construct($val) {$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;val = $val;}
    function get() {&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;val;}
}

$collection = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection(array(
    &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; emb(&apos;0&apos;),
    &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; emb(&apos;1&apos;),
    &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; emb(&apos;2&apos;)
));

&lt;span class=&quot;code-comment&quot;&gt;// TEST CASE:
&lt;/span&gt;$doc = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; doc($collection);

$dm-&amp;gt;persist($doc);
$dm-&amp;gt;flush();

&lt;span class=&quot;code-comment&quot;&gt;// place element &apos;0&apos; after &apos;1&apos;
&lt;/span&gt;$collection = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection(array(
    $collection[1],
    $collection[0],
    $collection[2]
));

$doc-&amp;gt;set($collection);

$dm-&amp;gt;persist($doc);
$dm-&amp;gt;flush();

$dm-&amp;gt;refresh($doc);

foreach($doc-&amp;gt;get() as $value) {
    echo $value-&amp;gt;get() . &lt;span class=&quot;code-quote&quot;&gt;&quot;\n&quot;&lt;/span&gt;;
}

&lt;span class=&quot;code-comment&quot;&gt;// expecting: 
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// 1
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// 0
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// 2
&lt;/span&gt;
&lt;span class=&quot;code-comment&quot;&gt;// getting: 
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// 2
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// 1
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// 0&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Is it an issue? Or is it supposed that ordering should be resolved in application code? &lt;/p&gt;</description>
                <environment></environment>
            <key id="11682">MODM-29</key>
            <summary>Persisting changes ordering of elements in embedded collection in some cases</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vladar">Vladimir Razuvaev</reporter>
                        <labels>
                    </labels>
                <created>Tue, 27 Jul 2010 00:38:46 +0000</created>
                <updated>Thu, 19 Aug 2010 03:54:56 +0000</updated>
                    <resolved>Wed, 18 Aug 2010 11:55:55 +0000</resolved>
                            <version>1.0.0ALPHA2</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Persister</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13707" author="jwage" created="Tue, 27 Jul 2010 00:54:41 +0000"  >&lt;p&gt;Hi, I think we should try and make it maintain the order. I will investigate.&lt;/p&gt;</comment>
                    <comment id="13713" author="jwage" created="Tue, 27 Jul 2010 10:58:33 +0000"  >&lt;p&gt;I am not sure if we can control the order. Mongo doesn&apos;t give us anyway to do this. We use $pullAll and $pushAll operators currently.&lt;/p&gt;

&lt;p&gt;Can you log that test and paste what queries are executed on mongo when persisting?&lt;/p&gt;</comment>
                    <comment id="13714" author="avalanche123" created="Tue, 27 Jul 2010 12:02:57 +0000"  >&lt;p&gt;I think that you should be getting 2,1,0 after the first flush as well, since we would not send an update after the second flush at all. We check whether the actual value in the collection changed or not, if you want the keys to be taken into account, you should use @Hash instead.&lt;/p&gt;</comment>
                    <comment id="13719" author="vladar" created="Wed, 28 Jul 2010 00:17:38 +0000"  >&lt;p&gt;I have just checked. After first flush I get expected result: 0, 1, 2. And for second flush Doctrine Persister generates following update query:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;Array
(
    [$pullAll] =&amp;gt; Array
        (
            [collection] =&amp;gt; Array
                (
                    [0] =&amp;gt; Array
                        (
                            [val] =&amp;gt; 0
                        )

                    [1] =&amp;gt; Array
                        (
                            [val] =&amp;gt; 1
                        )

                )

        )

    [$pushAll] =&amp;gt; Array
        (
            [collection] =&amp;gt; Array
                (
                    [0] =&amp;gt; Array
                        (
                            [val] =&amp;gt; 1
                        )

                    [1] =&amp;gt; Array
                        (
                            [val] =&amp;gt; 0
                        )

                )

        )

)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then it sequentally executes two updates: 1 for $pullAll and then another for $pushAll (due to &lt;a href=&quot;http://jira.mongodb.org/browse/SERVER-1050&quot; class=&quot;external-link&quot;&gt;http://jira.mongodb.org/browse/SERVER-1050&lt;/a&gt;). As a result 1, 0 are  pushed after 2 and we get 2,1,0. &lt;/p&gt;

&lt;p&gt;I think in many cases using $set would work as a  workaround for this issue. But as far as I understand there is no way to hint Doctrine to use $set currently. Or is it possible somehow?&lt;/p&gt;

&lt;p&gt;Hash won&apos;t work in this case, because it doesn&apos;t preserve classes of embedded objects.&lt;/p&gt;</comment>
                    <comment id="13736" author="jwage" created="Fri, 30 Jul 2010 13:28:12 +0000"  >&lt;p&gt;I think we can maybe allow you to force a collection to always use $set if you want to maintain ordering. The downside is it is much slower and not atomic. I don&apos;t know if it is a good idea, what do you think?&lt;/p&gt;</comment>
                    <comment id="13744" author="vladar" created="Sat, 31 Jul 2010 02:46:30 +0000"  >&lt;p&gt;Well, in my use case $set will work well, because embedded objects are small, there will be only 1-40 of them and saving operation is rare. I think this use-case is pretty usual, so $set will be definately useful.&lt;/p&gt;

&lt;p&gt;The alternative is to complicate application-code to resolve ordering on the client-side, which doesn&apos;t worth it in many cases. And people will use different workarounds as I did: currently I update all embedded objects with unique random token and Doctrine pulls/pushes them all back with valid ordering.&lt;/p&gt;</comment>
                    <comment id="13807" author="jwage" created="Sat, 7 Aug 2010 01:35:11 +0000"  >&lt;p&gt;In this commit &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/7a9e0088153e1f3f7f9a0650f5f7461bbc41ec64&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/7a9e0088153e1f3f7f9a0650f5f7461bbc41ec64&lt;/a&gt; I made it so that you can control the strategy for persisting. The default value is pushPull but you can also specify set so the entire value is re $set each time:&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;/** @Collection(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;set&quot;&lt;/span&gt;) */
/** @ReferenceMany(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;set&quot;&lt;/span&gt;) */
/** @EmbedMany(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;set&quot;&lt;/span&gt;) */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13972" author="vladar" created="Tue, 17 Aug 2010 06:55:37 +0000"  >&lt;p&gt;Discovered another related issue. There are situations with strategy &quot;set&quot;, when ODM generates following update query:&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;array (
  &apos;$set&apos; =&amp;gt; array (
    &apos;collection.1.val&apos; =&amp;gt; &apos;tmp&apos;,
    &apos;collection&apos; =&amp;gt; array (
      0 =&amp;gt; array (
        &apos;val&apos; =&amp;gt; &apos;1&apos;,
      ),
      1 =&amp;gt; array (
        &apos;val&apos; =&amp;gt; &apos;tmp&apos;,
      ),
      2 =&amp;gt; array (
        &apos;val&apos; =&amp;gt; &apos;2&apos;,
      ),
    ),
  ),
)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;E.g. when changing ordering of elements AND field value of any embedded document. &lt;br/&gt;
This update will only persist new field value, but not elements reordering.&lt;/p&gt;

&lt;p&gt;Full Test Case:&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;/** @Document(collection=&lt;span class=&quot;code-quote&quot;&gt;&quot;tests&quot;&lt;/span&gt;, db=&lt;span class=&quot;code-quote&quot;&gt;&quot;tests&quot;&lt;/span&gt;) */
class doc
{
    /** @Id */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $id;

    /** @EmbedMany(targetDocument=&lt;span class=&quot;code-quote&quot;&gt;&quot;emb&quot;&lt;/span&gt;, strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;set&quot;&lt;/span&gt;, cascade=&lt;span class=&quot;code-quote&quot;&gt;&quot;all&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $collection;

    /** @&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $tmp = &apos;&apos;; &lt;span class=&quot;code-comment&quot;&gt;// force save
&lt;/span&gt;
    function __construct($c) {$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;set($c);}

    function getId() {&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;id;}
    function set($c) {$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;collection = $c;}
    function get() {&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;collection;}
}

/** @EmbeddedDocument */
class emb
{
    /** @&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $val;

    function __construct($val) {$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;set($val);}
    function get() {&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;val;}
    function set($val) {$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;val = $val;}
}

$collection = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection(array(
    &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; emb(&apos;0&apos;),
    &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; emb(&apos;1&apos;),
    &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; emb(&apos;2&apos;)
));

&lt;span class=&quot;code-comment&quot;&gt;// TEST CASE:
&lt;/span&gt;$doc = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; doc($collection);

$dm-&amp;gt;persist($doc);
$dm-&amp;gt;flush();

&lt;span class=&quot;code-comment&quot;&gt;// place element &apos;0&apos; after &apos;1&apos;
&lt;/span&gt;$collection = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayCollection(array(
    $collection[1],
    $collection[0],
    $collection[2]
));

$doc-&amp;gt;set($collection);

&lt;span class=&quot;code-comment&quot;&gt;// changing value together with reordering causes issue when saving:
&lt;/span&gt;$collection[1]-&amp;gt;set(&apos;tmp&apos;);

$dm-&amp;gt;persist($doc);
$dm-&amp;gt;flush();

$dm-&amp;gt;refresh($doc);

foreach($doc-&amp;gt;get() as $value) {
    echo $value-&amp;gt;get() . &lt;span class=&quot;code-quote&quot;&gt;&quot;\n&quot;&lt;/span&gt;;
}

&lt;span class=&quot;code-comment&quot;&gt;// expecting: 
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// 1
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// 0
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// 2
&lt;/span&gt;
&lt;span class=&quot;code-comment&quot;&gt;// getting: 
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// 0
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// 1
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;// 2&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13995" author="vladar" created="Wed, 18 Aug 2010 04:28:35 +0000"  >&lt;p&gt;Reopening because of other related issue&lt;/p&gt;</comment>
                    <comment id="14002" author="jwage" created="Wed, 18 Aug 2010 11:38:21 +0000"  >&lt;p&gt;So the &quot;&apos;collection.1.val&apos; =&amp;gt; &apos;tmp&apos;,&quot; part succeeds and the rest is ignored? Obviously the &apos;collection.1.val&apos; =&amp;gt; &apos;tmp&apos;, part should not be there.&lt;/p&gt;</comment>
                    <comment id="14003" author="jwage" created="Wed, 18 Aug 2010 11:40:09 +0000"  >&lt;p&gt;Hi, to make things easier would you mind making the test cases in the Doctrine test suite? Every test case you provide is great and it works but I have to spend a few minutes modifying the code and putting it into a test case in phpunit.&lt;/p&gt;</comment>
                    <comment id="14004" author="jwage" created="Wed, 18 Aug 2010 11:51:38 +0000"  >&lt;p&gt;Why are you expecting 1, 0, 2? Wouldn&apos;t the change to &apos;tmp&apos; need to be persisted as well?&lt;/p&gt;</comment>
                    <comment id="14005" author="jwage" created="Wed, 18 Aug 2010 11:55:46 +0000"  >&lt;p&gt;Fixed here &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/485fbdfb7f85ecb290530ea0fc9c55a6dca91e19&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/485fbdfb7f85ecb290530ea0fc9c55a6dca91e19&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I think the expected values and order would be &quot;1, tmp, 2&quot;&lt;/p&gt;</comment>
                    <comment id="14012" author="vladar" created="Thu, 19 Aug 2010 03:54:56 +0000"  >&lt;p&gt;Yeah, sorry, expecting &quot;1, tmp, 2&quot; of course.&lt;/p&gt;

&lt;p&gt;As for tests - I&apos;ll setup Doctrine tests on my side. How should I deliver test cases then? Via github? Or just copy-paste phpunit tests here?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-20] SINGLE_COLLECTION inheritance does not work</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-20</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;It seems that SINGLE_COLLECTION inheritance is not implemented?&lt;/p&gt;

&lt;p&gt;Method UnitOfWork::getOrCreateDocument calls Mapping\Metadata::newInstance without taking possible discriminator map into account.&lt;/p&gt;

&lt;p&gt;The example in the official documentation (&lt;a href=&quot;http://www.doctrine-project.org/projects/mongodb_odm/1.0/docs/reference/inheritance-mapping/en&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/mongodb_odm/1.0/docs/reference/inheritance-mapping/en&lt;/a&gt;) is not a real test: the object is first created as a child-class instance before being queried through the parent class, so the object is returned without hydration, from the UnitOfWork identityMap cache.&lt;/p&gt;

&lt;p&gt;The corresponding code from Doctrine\ORM is in Doctrine\ORM\Internal\Hydration\ObjectHydrator::_getEntity (find class name through discriminator map, if any).&lt;/p&gt;</description>
                <environment>PHP 5.3.1, Doctrine ODM MongoDB 2010-06-22 16:07:10</environment>
            <key id="11546">MODM-20</key>
            <summary>SINGLE_COLLECTION inheritance does not work</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="okapi">Okapi</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Jun 2010 10:01:42 +0000</created>
                <updated>Wed, 24 Nov 2010 13:10:19 +0000</updated>
                    <resolved>Wed, 24 Nov 2010 13:10:19 +0000</resolved>
                            <version>1.0.0ALPHA2</version>
                                <fixVersion>1.0.0BETA2</fixVersion>
                                <component>Hydration</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13521" author="jwage" created="Mon, 5 Jul 2010 12:27:33 +0000"  >&lt;p&gt;It is just not implemented/finished yet. I will fix the code you mention soon. Thanks, Jon&lt;/p&gt;</comment>
                    <comment id="14239" author="okapi" created="Thu, 2 Sep 2010 12:40:58 +0000"  >&lt;p&gt;Hi Jon,&lt;/p&gt;

&lt;p&gt;Indeed, hydration seems aware of the discriminator map now (I only use Single Collection inheritance).&lt;/p&gt;

&lt;p&gt;But the discriminator map seems ignored when a document is fetched through its ID (eg. DM::find($class, $id) ).&lt;/p&gt;

&lt;p&gt;Because of that, I just can&apos;t use this inheritance model. I can&apos;t see any possible workaround, since the discriminator field is no longer allowed to be declared in the class.&lt;/p&gt;


&lt;p&gt;Other point which is not a bug but a suggestion : instead of using a static discrminator map, couldn&apos;t we register an inflector class? Indeed, in most use cases, the document class name is the mere concatenation of the base class with a backslash followed by the camel-cased discriminator value.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;Okapi&lt;/p&gt;</comment>
                    <comment id="14244" author="jwage" created="Thu, 2 Sep 2010 15:11:19 +0000"  >&lt;p&gt;Hi, the discriminator map should be used in both DocumentManager::find() and findOne()&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/mongodb-odm/blob/master/lib/Doctrine/ODM/MongoDB/MongoCollection.php#L285&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/blob/master/lib/Doctrine/ODM/MongoDB/MongoCollection.php#L285&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://github.com/doctrine/mongodb-odm/blob/master/lib/Doctrine/ODM/MongoDB/MongoCollection.php#L315&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/blob/master/lib/Doctrine/ODM/MongoDB/MongoCollection.php#L315&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As far as the inflector class, we have to specify the full discriminator map on the parent class because otherwise we would have to load all the mapping information for all the subclasses to know the information.&lt;/p&gt;

&lt;p&gt;Can you give some kind of test code or a test case or something for your reason to re-open?&lt;/p&gt;</comment>
                    <comment id="14252" author="okapi" created="Fri, 3 Sep 2010 08:53:59 +0000"  >&lt;p&gt;Hi, indeed. I&apos;ve had difficulties in running the PHPUnit tests, but have struggled on the issue within my app long enough to have a clear scenario.&lt;/p&gt;

&lt;p&gt;Consider the following unit test:&lt;br/&gt;
Doctrine\ODM\MongoDB\Tests\Functional\InheritanceTest::testSingleCollectionInhertiance()&lt;/p&gt;

&lt;p&gt;Data has been inserted according to the code before $this-&amp;gt;dm-&amp;gt;clear();&lt;/p&gt;

&lt;p&gt;Now, in a new PHP instance (web req or CLI proc) (to avoid taking any risk related to the reliability of DocumentManager::clear() and make sure objects are freshly hydrated ),&lt;/p&gt;

&lt;p&gt;The follow assertion should be OK (I would expect it to be in the test, as it represents the purpose of the discriminator map):&lt;br/&gt;
        $document = $this-&amp;gt;dm-&amp;gt;findOne(&apos;Documents\Project&apos;, array(&apos;name&apos; =&amp;gt; &apos;Sub Project&apos;));&lt;br/&gt;
        $this-&amp;gt;assertInstanceOf(&apos;Documents\SubProject&apos;, $document);&lt;/p&gt;

&lt;p&gt;Now, suppose $id is the identifier value of $document as returned by the former code.&lt;br/&gt;
The following assertion should be also true:&lt;br/&gt;
        $document = $this-&amp;gt;dm-&amp;gt;find(&apos;Documents\Project&apos;, $id);&lt;br/&gt;
        $this-&amp;gt;assertInstanceOf(&apos;Documents\SubProject&apos;, $document);&lt;/p&gt;

&lt;p&gt;This former test would fail in my case (doc class is Documents\Project as queried).&lt;/p&gt;

&lt;p&gt;To me, the purpose of single inheritance is when we don&apos;t know by advance the class of the object that hydration will yield. The query is made on a common document class, and the class of each returned document will depend on the discriminator field.&lt;br/&gt;
In a typical application, these classes would implement a common interface. Having the possibility to isolate the implementation (concrete class) from the query is a key feature to benefit from the schema-less character of a NoSQL DB.&lt;/p&gt;

&lt;p&gt;Am I right, or missing something?&lt;/p&gt;
</comment>
                    <comment id="14260" author="jwage" created="Fri, 3 Sep 2010 12:22:13 +0000"  >&lt;p&gt;That is correct, this is how it is intended to work and as far as I&apos;ve tested it is working that way. I even added your code to the test and it passes: &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/54f68d9a4623ec7daa18bf5671ebba778bbc0df8&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/54f68d9a4623ec7daa18bf5671ebba778bbc0df8&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14285" author="okapi" created="Mon, 6 Sep 2010 11:27:43 +0000"  >&lt;p&gt;Hello, after hours of seeking the cause why Doctrine tests pass and mines don&apos;t although very similar to each other!!&lt;/p&gt;

&lt;p&gt;Answer is: in my project, the base document class which declares the single inheritance behaviour does not include itself in the discriminator map.&lt;/p&gt;

&lt;p&gt;Indeed, in the unit tests, Documents\Project is used for both a collection (to query from) and an implementation (of documents with type &quot;project&quot;).&lt;/p&gt;

&lt;p&gt;In my project, the &quot;collection document class&quot; (setting up the inheritance) is abstract. For now, to please Doctrine ODM, I have included it in the discriminator map under the dumb key &quot;abstract&quot;. Doctrine seems fine with it, but there is a logical problem, in the sense that it may try innocently  to instanciate my abstract class if it fetches from MongoDB a document with the corresponding type.&lt;/p&gt;

&lt;p&gt;What do you think?&lt;/p&gt;

&lt;p&gt;Thinking of the case where a fetched document does not match an item in the discriminator map, does the hydrator fall back to the main document class?&lt;br/&gt;
Should we have an annotation like @DiscriminatorFallbackValue or @DiscriminatorFallbackDocument ?&lt;/p&gt;

&lt;p&gt;If I have suggestions / thinking about how inheritance can be better used, where do you want me to write them? Here or on the forum?&lt;/p&gt;</comment>
                    <comment id="14286" author="jwage" created="Mon, 6 Sep 2010 11:58:20 +0000"  >&lt;p&gt;Can you make a test then with how your entities are setup so I can work on a patch?&lt;/p&gt;</comment>
                    <comment id="14298" author="okapi" created="Tue, 7 Sep 2010 06:08:03 +0000"  >&lt;p&gt;Sorry, I don&apos;t have a Github account, and am leaving for a week-long trip, so I don&apos;t have th etime yet to make a proper contribution.&lt;/p&gt;

&lt;p&gt;However, I have modified tests&apos; Documents\Project, added Documents\OtherSubProject and updated Doctrine\ODM\MongoDB\Tests\Functional\InheritanceTest. Here is a tar.gz of these 3 files.&lt;/p&gt;

&lt;p&gt;The instanceOf assertions fails, as the hydrator always returns Documents\Project objects, whatever the &quot;type&quot; is.&lt;br/&gt;
Note that adding &quot;project&quot;=&quot;Documents\Project&quot; to the discriminator map makes the test pass again.&lt;/p&gt;</comment>
                    <comment id="14810" author="jwage" created="Wed, 24 Nov 2010 13:10:19 +0000"  >&lt;p&gt;I&apos;m pretty certain this is fixed now. I ran your test and it is passing now. I merged the changes and committed it.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10778" name="unit_test.tar.gz" size="1187" author="okapi" created="Tue, 7 Sep 2010 06:08:03 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>