<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Wed May 22 12:01:04 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+status+%3D+Resolved+ORDER+BY+priority+DESC&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+status+%3D+Resolved+ORDER+BY+priority+DESC</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="115" total="115"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<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-76] I get an error when trying to persist a document</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-76</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;This is the error I get:&lt;/p&gt;

&lt;p&gt;get_class() expects parameter 1 to be object, array given.&lt;/p&gt;

&lt;p&gt;Stack Trace:&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;#0 [internal function]: {closure}(2, &apos;get_class() exp...&apos;, &apos;/Library/WebSer...&apos;, 562, Array)
#1 /Library/WebServer/Documents/ktapi/library/Doctrine/ODM/MongoDB/Persisters/BasicDocumentPersister.php(562): get_class(Array)
#2 /Library/WebServer/Documents/ktapi/library/Doctrine/ODM/MongoDB/Persisters/BasicDocumentPersister.php(545): Doctrine\ODM\MongoDB\Persisters\BasicDocumentPersister-&amp;gt;prepareReferencedDocValue(Array, Array)
#3 /Library/WebServer/Documents/ktapi/library/Doctrine/ODM/MongoDB/Persisters/BasicDocumentPersister.php(536): Doctrine\ODM\MongoDB\Persisters\BasicDocumentPersister-&amp;gt;prepareValue(Array, Array)
#4 /Library/WebServer/Documents/ktapi/library/Doctrine/ODM/MongoDB/Persisters/BasicDocumentPersister.php(463): Doctrine\ODM\MongoDB\Persisters\BasicDocumentPersister-&amp;gt;prepareValue(Array, Array)
#5 /Library/WebServer/Documents/ktapi/library/Doctrine/ODM/MongoDB/Persisters/BasicDocumentPersister.php(209): Doctrine\ODM\MongoDB\Persisters\BasicDocumentPersister-&amp;gt;prepareUpdateData(Object(App_Model_Ticket))
#6 /Library/WebServer/Documents/ktapi/library/Doctrine/ODM/MongoDB/UnitOfWork.php(771): Doctrine\ODM\MongoDB\Persisters\BasicDocumentPersister-&amp;gt;update(Object(App_Model_Ticket), Array)
#7 /Library/WebServer/Documents/ktapi/library/Doctrine/ODM/MongoDB/UnitOfWork.php(281): Doctrine\ODM\MongoDB\UnitOfWork-&amp;gt;executeUpdates(Object(Doctrine\ODM\MongoDB\Mapping\ClassMetadata), Array)
#8 /Library/WebServer/Documents/ktapi/library/Doctrine/ODM/MongoDB/DocumentManager.php(503): Doctrine\ODM\MongoDB\UnitOfWork-&amp;gt;commit(Array)
#9 /Library/WebServer/Documents/ktmodels/library/App/Model/Service/Dao/Doctrine.php(26): Doctrine\ODM\MongoDB\DocumentManager-&amp;gt;flush()
#10 /Library/WebServer/Documents/ktmodels/library/App/Model/Service/Abstract.php(54): App_Model_Service_Dao_Doctrine-&amp;gt;save(Object(App_Model_Ticket))
#11 /Library/WebServer/Documents/ktmodels/library/App/Model/Abstract.php(215): App_Model_Service_Abstract-&amp;gt;save(Object(App_Model_Ticket))
#12 /Library/WebServer/Documents/ktmodels/library/App/Model/Ticket.php(84): App_Model_Abstract-&amp;gt;save()
#13 /Library/WebServer/Documents/ktapi/application/controllers/TicketController.php(145): App_Model_Ticket-&amp;gt;save()
#14 /Library/WebServer/Documents/ktapi/library/Zend/Controller/Action.php(513): TicketController-&amp;gt;putAction()
#15 /Library/WebServer/Documents/ktapi/library/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action-&amp;gt;dispatch(&apos;putAction&apos;)
#16 /Library/WebServer/Documents/ktapi/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard-&amp;gt;dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#17 /Library/WebServer/Documents/ktapi/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front-&amp;gt;dispatch()
#18 /Library/WebServer/Documents/ktapi/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap-&amp;gt;run()
#19 /Library/WebServer/Documents/ktapi/public/index.php(34): Zend_Application-&amp;gt;run()
#20 {main}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Please tell me how I can be more precise or of more help. Do you need my models for debugging? (I do not want to post them here).&lt;/p&gt;</description>
                <environment></environment>
            <key id="11910">MODM-76</key>
            <summary>I get an error when trying to persist a document</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="sebastian.hoitz">Sebastian Hoitz</reporter>
                        <labels>
                    </labels>
                <created>Sat, 11 Sep 2010 14:32:21 +0000</created>
                <updated>Mon, 20 Sep 2010 11:53:34 +0000</updated>
                    <resolved>Mon, 20 Sep 2010 11:53:34 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14340" author="sebastian.hoitz" created="Sat, 11 Sep 2010 15:29:56 +0000"  >&lt;p&gt;I got the latest version from Github and this error still occures.&lt;/p&gt;

&lt;p&gt;I also checked with my models. Before persisting my model with Doctrine all the referenced models are Documents. Somewhere in the Persister the model has to get changed to an array.&lt;/p&gt;</comment>
                    <comment id="14341" author="sebastian.hoitz" created="Sat, 11 Sep 2010 15:51:15 +0000"  >&lt;p&gt;The issue seems to be in this &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/blob/master/lib/Doctrine/ODM/MongoDB/Persisters/BasicDocumentPersister.php#L419&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/blob/master/lib/Doctrine/ODM/MongoDB/Persisters/BasicDocumentPersister.php#L419&lt;/a&gt; method.&lt;/p&gt;

&lt;p&gt;When calculating the changeset we end up with an array. When this array is passed on to prepareValue in &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/blob/master/lib/Doctrine/ODM/MongoDB/Persisters/BasicDocumentPersister.php#L464&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/blob/master/lib/Doctrine/ODM/MongoDB/Persisters/BasicDocumentPersister.php#L464&lt;/a&gt; this method can not handle the array.&lt;/p&gt;

&lt;p&gt;I hope this helps a bit with pinpointing the error.&lt;/p&gt;</comment>
                    <comment id="14362" author="sebastian.hoitz" created="Mon, 13 Sep 2010 13:10:00 +0000"  >&lt;p&gt;I changed the prepareReferencedDocValue method in BasicDocumentPersister.php to 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;&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; function prepareReferencedDocValue(array $referenceMapping, $document)
	{
		$id = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;

		&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (is_array($document))
		{
			$className = $referenceMapping[&apos;targetDocument&apos;];
		}
		&lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
		{
			$className = get_class($document);
			$id = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;uow-&amp;gt;getDocumentIdentifier($document);
		}

		$class = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;getClassMetadata($className);

		&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; !== $id)
		{
			$id = $class-&amp;gt;getDatabaseIdentifierValue($id);
		}
		$ref = array(
				$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;cmd . &apos;ref&apos; =&amp;gt; $class-&amp;gt;getCollection(),
				$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;cmd . &apos;id&apos; =&amp;gt; $id,
				$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;cmd . &apos;db&apos; =&amp;gt; $class-&amp;gt;getDB()
		);
		&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!isset($referenceMapping[&apos;targetDocument&apos;]))
		{
			$discriminatorField = isset($referenceMapping[&apos;discriminatorField&apos;]) ? $referenceMapping[&apos;discriminatorField&apos;] : &apos;_doctrine_class_name&apos;;
			$discriminatorValue = isset($referenceMapping[&apos;discriminatorMap&apos;]) ? array_search($class-&amp;gt;getName(), $referenceMapping[&apos;discriminatorMap&apos;]) : $class-&amp;gt;getName();
			$ref[$discriminatorField] = $discriminatorValue;
		}
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $ref;
	}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and this seems to solve the issue.&lt;/p&gt;

&lt;p&gt;However, I was not able to get the whole Doctrine ODM unit testing set up, so I could not check if all unit tests still pass.&lt;/p&gt;

&lt;p&gt;I would love if somebody could help me getting the github and unit testing environment for Doctrine set up, so that I can work on some issues too!&lt;/p&gt;</comment>
                    <comment id="14422" author="sebastian.hoitz" created="Mon, 20 Sep 2010 11:53:34 +0000"  >&lt;p&gt;Resolved with this commit:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/sebastianhoitz/mongodb-odm/commit/9ec340697b184284f420e077457127f3147566e0&quot; class=&quot;external-link&quot;&gt;http://github.com/sebastianhoitz/mongodb-odm/commit/9ec340697b184284f420e077457127f3147566e0&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Includes test case to reproduce the issue.&lt;/p&gt;</comment>
                </comments>
                    <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-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-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-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-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-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-23] Embeded objects gets doubled [see description for the whole scenario]</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-23</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;If you have the database structure as:&lt;br/&gt;
&apos;Group&apos; Collection has &apos;tables&apos; (ReferenceMany targetDocument=&quot;Documents\Table&quot;) and &apos;chairs&apos; (ReferenceMany targetDocument=&quot;Documents\Chair&quot;).&lt;br/&gt;
&apos;Table&apos; Collection has &apos;glasses&apos; (EmbedMany targetDocument=&quot;Documents\Glass&quot;) and a name as (@String).&lt;br/&gt;
&apos;Chair&apos; Collection has a name as (@String) and tablenames as (@Hash).&lt;br/&gt;
&apos;Glass&apos; Collection has name as (@String).&lt;/p&gt;

&lt;p&gt;First, I simply add a glass to table and add that table to group. And create a chair and add it to group also.&lt;br/&gt;
                $dm = $this-&amp;gt;doctrine-&amp;gt;getDM();&lt;br/&gt;
		$group = new Group();&lt;br/&gt;
		$table = new Table();&lt;br/&gt;
		$chair = new Chair();&lt;br/&gt;
		$glass = new Glass();&lt;/p&gt;

&lt;p&gt;		$group-&amp;gt;tables[] = $table;&lt;br/&gt;
		$group-&amp;gt;chairs[] = $chair;&lt;br/&gt;
		$table-&amp;gt;glasses[] = $glass;&lt;/p&gt;

&lt;p&gt;		$dm-&amp;gt;persist($group);&lt;br/&gt;
                $dm-&amp;gt;flush();&lt;br/&gt;
*At this point the tablenames in &apos;Chair&apos; collection is not entered.&lt;/p&gt;

&lt;p&gt;Now I call a function, which adds a new chair;&lt;br/&gt;
function addChair()&lt;br/&gt;
	{&lt;br/&gt;
		$dm = $this-&amp;gt;doctrine-&amp;gt;getDM();&lt;br/&gt;
		$chair = new Chair();&lt;br/&gt;
		$group = $dm-&amp;gt;createQuery(&apos;Documents\Group&apos;)&lt;br/&gt;
			-&amp;gt;where(&apos;name&apos;,&apos;group&apos;)&lt;br/&gt;
			-&amp;gt;getSingleResult();&lt;br/&gt;
		foreach($group-&amp;gt;tables as $table)&lt;/p&gt;
		{
			$chair-&amp;gt;tableNames[] = $table-&amp;gt;name;

		}
&lt;p&gt;		$group-&amp;gt;chairs[] = $chair;&lt;br/&gt;
		$dm-&amp;gt;persist($chair);&lt;br/&gt;
		$dm-&amp;gt;flush();&lt;br/&gt;
	}&lt;/p&gt;

&lt;p&gt;and as mentioned I traverse on tables to get table names and add those name in a new &apos;Chair&apos; Collection&apos;s tablenames (@Hash).&lt;/p&gt;

&lt;p&gt;Now in Db I have:&lt;br/&gt;
a group with two chairs and a table (both Referenced).&lt;br/&gt;
two chairs (one with an array of &quot;tablenames&quot; and one doesn&apos;t have &quot;tablenames&quot;),&lt;br/&gt;
a table with &quot;TWO&quot; embedded glasses &amp;lt;&amp;lt;--this is very strange I never added another glass to table!!!!&lt;/p&gt;

&lt;p&gt;Note: As I call &quot;addChair()&quot; one more time the glasses in table get multiplied by two!!!&lt;br/&gt;
Please fix this asap.&lt;br/&gt;
Thanks&lt;br/&gt;
Regards&lt;br/&gt;
Ahsan&lt;/p&gt;</description>
                <environment>Ubuntu with LAMP. I am using Code Igniter.</environment>
            <key id="11571">MODM-23</key>
            <summary>Embeded objects gets doubled [see description for the whole scenario]</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="asymptote">Ahsan Shafiq</reporter>
                        <labels>
                    </labels>
                <created>Wed, 30 Jun 2010 06:21:33 +0000</created>
                <updated>Tue, 13 Jul 2010 10:41:51 +0000</updated>
                    <resolved>Tue, 13 Jul 2010 10:41:51 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13529" author="avalanche123" created="Tue, 6 Jul 2010 18:53:52 +0000"  >&lt;p&gt;this should be resolved in the current trunk&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10682" name="glass multiplier.zip" size="2152" author="asymptote" created="Wed, 30 Jun 2010 06:21:33 +0000" />
                    <attachment id="10683" name="glass multiplier.zip" size="2152" author="asymptote" created="Wed, 30 Jun 2010 06:21:33 +0000" />
                    <attachment id="10684" name="glass multiplier.zip" size="2152" author="asymptote" created="Wed, 30 Jun 2010 06:21:33 +0000" />
                </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-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-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-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-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-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-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-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-78] mappedSuperclass as parent embedded class</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-78</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;i have 3 documents : a contact,  a professional address and a personal address&lt;br/&gt;
A contact embed the 2 addresses&lt;/p&gt;

&lt;p&gt;The &lt;b&gt;Contact&lt;/b&gt;  class inherits from an abstract class &lt;b&gt;DomainAbstract&lt;/b&gt;&lt;br/&gt;
The 2 &lt;b&gt;addresses&lt;/b&gt; classes inherits from an abstract class &lt;b&gt;Address&lt;/b&gt; which inherits from &lt;b&gt;DomainAbstract&lt;/b&gt; &lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;DomainAbstract  &amp;lt;- Contact&lt;/li&gt;
	&lt;li&gt;DomainAbstract &amp;lt;- Address &amp;lt;-   PersonalAddress, ProfessionalAddress&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;DomainAbstract is defined as &lt;b&gt;mappedSuperclass&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Address is defined as &lt;b&gt;mappedSuperclass&lt;/b&gt; &lt;/p&gt;

&lt;p&gt;PersonalAddress, ProfessionalAddress  are &lt;b&gt;embeddedDocument&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;But the fields defined by address are not inherited by embedded PersonalAddress and ProfessionalAddress ( but the fields in domainAbstract are like expected)&lt;/p&gt;

&lt;p&gt;I think, 2 levels of inheritance and embedded document is wrong...&lt;/p&gt;

&lt;p&gt;thx for help&lt;/p&gt;

&lt;p&gt;ps: yaml mapping&lt;/p&gt;
</description>
                <environment></environment>
            <key id="11914">MODM-78</key>
            <summary>mappedSuperclass as parent embedded 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="5">Cannot Reproduce</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jenreve">julien rollin</reporter>
                        <labels>
                    </labels>
                <created>Mon, 13 Sep 2010 04:47:14 +0000</created>
                <updated>Fri, 11 Feb 2011 15:58:41 +0000</updated>
                    <resolved>Fri, 11 Feb 2011 15:58:41 +0000</resolved>
                                                            <component>Mapping Drivers</component>
                <component>Persister</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14822" author="jwage" created="Wed, 24 Nov 2010 14:13:49 +0000"  >&lt;p&gt;Could you provide a test case or the files you are using to produce the problem?&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-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-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-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-64] @DynamicFields</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-64</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;I suggest adding a new feature called @DynamicFields. The idea is from roman and documeneted here: &lt;a href=&quot;http://github.com/romanb/couchdb-persistence-api/blob/master/src/main/java/org/code_factory/couch/annotations/DynamicFields.java&quot; class=&quot;external-link&quot;&gt;http://github.com/romanb/couchdb-persistence-api/blob/master/src/main/java/org/code_factory/couch/annotations/DynamicFields.java&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Idea: Save all &quot;left-over&quot; fields of the result in an array.&lt;/p&gt;

&lt;p&gt;This would greatly enhance the flexibility of document mappers&lt;/p&gt;</description>
                <environment></environment>
            <key id="11843">MODM-64</key>
            <summary>@DynamicFields</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="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="beberlei">Benjamin Eberlei</reporter>
                        <labels>
                    </labels>
                <created>Sat, 28 Aug 2010 10:54:56 +0000</created>
                <updated>Mon, 30 Aug 2010 14:40:26 +0000</updated>
                    <resolved>Mon, 30 Aug 2010 14:40:26 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14131" author="jwage" created="Sat, 28 Aug 2010 11:25:47 +0000"  >&lt;p&gt;Nice idea! So something like this could essentially work:&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 */
class User
{
    /** @DynamicFields */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $data;
}

$user = $dm-&amp;gt;find(....);
echo $user-&amp;gt;data[&apos;username&apos;];
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I am not sure if it is a good idea to just allow them to use a single @DynamicFields, maybe we should throw an exception if they use it that way? Also, if they modify a value inside $data should we persist the changes?&lt;/p&gt;</comment>
                    <comment id="14132" author="beberlei" created="Sat, 28 Aug 2010 12:34:42 +0000"  >&lt;p&gt;i guess the semantics should be, just one dynamic fields per entity allowed and that is inlined into the &quot;normal&quot; fields using array_merge() ?&lt;/p&gt;</comment>
                    <comment id="14133" author="beberlei" created="Sun, 29 Aug 2010 02:37:56 +0000"  >&lt;p&gt;ok maybe array_merge() is a bit dangerous, when the dynamic field has a property named like a real property.&lt;/p&gt;

&lt;p&gt;But you could do $data = array_merge($dynamicData, $staticData); and should be fine then semantically, of course this should be documented &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;I think you should have at least an ID or not? but something like this would even be very fast for prototyping:&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 */
class User
{
    /** @Id @Field */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;

    /** @DynamicFields */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $data;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="14145" author="jwage" created="Sun, 29 Aug 2010 15:23:49 +0000"  >&lt;p&gt;After thinking about it and discussing it I think the @Collection type can do what is needed:&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 */
class User
{
    /** @Id */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;

    /** @Collection */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $data = array();
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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-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-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-146] Doctrine MongoDB ODM load referenced documents ends in an endless loop</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-146</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Description of the problem here:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://stackoverflow.com/questions/6103483/doctrine-mongodb-odm-load-referenced-documents&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/6103483/doctrine-mongodb-odm-load-referenced-documents&lt;/a&gt;&lt;/p&gt;</description>
                <environment>PHP Zend Framework on Ubuntu 10.10</environment>
            <key id="12664">MODM-146</key>
            <summary>Doctrine MongoDB ODM load referenced documents ends in an endless loop</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="2">Won&apos;t Fix</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ssalat">Stephan Salat</reporter>
                        <labels>
                    </labels>
                <created>Tue, 24 May 2011 17:46:25 +0000</created>
                <updated>Sat, 28 May 2011 08:21:47 +0000</updated>
                    <resolved>Sat, 28 May 2011 08:21:47 +0000</resolved>
                            <version>1.0.0BETA3</version>
                                                <component>Hydration</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="15893" author="ssalat" created="Sat, 28 May 2011 08:21:47 +0000"  >&lt;p&gt;&lt;a href=&quot;http://stackoverflow.com/questions/6103483/doctrine-mongodb-odm-load-referenced-documents&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/6103483/doctrine-mongodb-odm-load-referenced-documents&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-125] Doctrine\ODM\MongoDB\MongoCollection::findOne does not invoke postFindOne event handlers doing query against MongoGridFS collection</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-125</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;subj&lt;/p&gt;

&lt;p&gt;it happens because the code goes out of the function at line 334 in file &lt;br/&gt;
\Doctrine\ODM\MongoDB\MongoCollection.php &lt;br/&gt;
without invoking appropriate event handlers&lt;/p&gt;

&lt;p&gt;thanks!&lt;/p&gt;</description>
                <environment>CentOS, PHP 5.3</environment>
            <key id="12405">MODM-125</key>
            <summary>Doctrine\ODM\MongoDB\MongoCollection::findOne does not invoke postFindOne event handlers doing query against MongoGridFS 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="5">Cannot Reproduce</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vkaplich">Vitaliy Kaplich</reporter>
                        <labels>
                    </labels>
                <created>Fri, 18 Feb 2011 13:59:58 +0000</created>
                <updated>Fri, 4 Mar 2011 10:44:12 +0000</updated>
                    <resolved>Fri, 4 Mar 2011 10:38:06 +0000</resolved>
                            <version>1.0.0BETA2</version>
                                <fixVersion>1.0.0BETA3</fixVersion>
                                <component>Mongo, MongoCollection, MongoCursor</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15338" author="vkaplich" created="Fri, 18 Feb 2011 14:40:19 +0000"  >&lt;p&gt;And the same bug with Doctrine\ODM\MongoDB\MongoCollection::getDBRef method as well&lt;/p&gt;</comment>
                    <comment id="15445" author="jwage" created="Fri, 4 Mar 2011 10:35:10 +0000"  >&lt;p&gt;Which version are you using? I don&apos;t see this behavior any longer. Can you confirm?&lt;/p&gt;</comment>
                    <comment id="15446" author="jwage" created="Fri, 4 Mar 2011 10:36:55 +0000"  >&lt;p&gt;Also, getDBRef() notifies the pre/postGetDBRef events.&lt;/p&gt;</comment>
                    <comment id="15447" author="jwage" created="Fri, 4 Mar 2011 10:38:06 +0000"  >&lt;p&gt;If you can still reproduce the issue can you provide a test case for us to run?&lt;/p&gt;</comment>
                    <comment id="15448" author="vkaplich" created="Fri, 4 Mar 2011 10:44:12 +0000"  >&lt;p&gt;I&apos;m using 1.0.0BETA1&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/doctrine/mongodb-odm/blob/1.0.0BETA1/lib/Doctrine/ODM/MongoDB/MongoCollection.php&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/mongodb-odm/blob/1.0.0BETA1/lib/Doctrine/ODM/MongoDB/MongoCollection.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;there is a &quot;return&quot; at line 338&lt;/p&gt;

&lt;p&gt;so the function invoke &quot;preFindOne&quot; but not &quot;postFindOne&quot;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-124] ClassMetadata shouldn&apos;t store defaultDb value</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-124</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Currently if document doesn&apos;t have &quot;db&quot; mapping, it is taken from defaultDb configuration and assigned to classmetadata (in ClassMetadataFactory).&lt;/p&gt;

&lt;p&gt;But if we have two documentManagers with different defaultDb configuration, second manager&apos;s configuration will be ignored, because &quot;db&quot; value is already set in classMetadata (when the 1st manager was created).&lt;/p&gt;

&lt;p&gt;It gets worse with metadata caching, as defaultDb setting is only taken in account when metadata is stored in cache. &lt;/p&gt;

&lt;p&gt;This affects a common use-case, when each customer has his own database and defaultDb is defined at runtime.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12404">MODM-124</key>
            <summary>ClassMetadata shouldn&apos;t store defaultDb value</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, 18 Feb 2011 07:05:20 +0000</created>
                <updated>Fri, 4 Mar 2011 10:56:01 +0000</updated>
                    <resolved>Fri, 4 Mar 2011 10:56:01 +0000</resolved>
                            <version>1.0.0BETA2</version>
                                <fixVersion>1.0.0BETA3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15449" author="jwage" created="Fri, 4 Mar 2011 10:56:01 +0000"  >&lt;p&gt;Hi, this is fixed here &lt;a href=&quot;https://github.com/doctrine/mongodb-odm/commit/6b91d944e68bbf94702a38351f03c74b7d6a057a&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/mongodb-odm/commit/6b91d944e68bbf94702a38351f03c74b7d6a057a&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reporting the issue.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-122] array_slice fails on ReferenceMany and EmbeddedMany fields</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-122</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;I am not sure if it&apos;s a bug of the framework or a bug in implementation of array_slice function in PHP&lt;br/&gt;
but when I try to pass @ReferenceMany field value into array_slice built-in PHP function it fails with error:&lt;/p&gt;

&lt;p&gt;==============================================&lt;br/&gt;
array_slice() expects parameter 1 to be array, object given&lt;br/&gt;
==============================================&lt;/p&gt;

&lt;p&gt;I know that PersistentCollection has method &quot;slice&quot; (at least in master branch) but my concern is backward compatibility with the code which treats ReferenceMany type fields as arrays.&lt;br/&gt;
The old code works perfectly until it uses array_slice.&lt;/p&gt;

&lt;p&gt;Please let me know are there any workarounds for this or probably you guys are going to implement some fix?&lt;/p&gt;

&lt;p&gt;Thanks a lot!&lt;/p&gt;</description>
                <environment>CentOS, PHP 5.3</environment>
            <key id="12402">MODM-122</key>
            <summary>array_slice fails on ReferenceMany and EmbeddedMany fields</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="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vkaplich">Vitaliy Kaplich</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Feb 2011 14:19:25 +0000</created>
                <updated>Thu, 17 Feb 2011 19:39:40 +0000</updated>
                    <resolved>Thu, 17 Feb 2011 19:39:40 +0000</resolved>
                            <version>1.0.0BETA1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15334" author="jwage" created="Thu, 17 Feb 2011 19:39:39 +0000"  >&lt;p&gt;Hi, you need to pass an array so you can convert the iterator to an array with the iterator_to_array() method or call -&amp;gt;toArray() on the PersistentCollection. Then you can pass that array to array_slice()&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-117] &quot;name&quot; attribute in @Field annotation</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-117</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;It looks like that &quot;name&quot; attribute is not supported anymore in @Field annotation&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/projects/mongodb_odm/1.0/docs/reference/annotations-reference/en#ann_field&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/mongodb_odm/1.0/docs/reference/annotations-reference/en#ann_field&lt;/a&gt;&lt;br/&gt;
&amp;gt; name - By default the property name is used for the mongodb field name also, however the &apos;name&apos; attribute allows you to specify the field name.&lt;/p&gt;

&lt;p&gt;For instance the code below produces a document inside &quot;mydocs&quot; collection which has only one property &quot;first_name&quot; instead of two:&lt;/p&gt;

&lt;p&gt;/** @Document(collection=&quot;mydocs&quot;) */&lt;br/&gt;
class MyDocument&lt;br/&gt;
{&lt;br/&gt;
	/** @Id */&lt;br/&gt;
	public $id;&lt;/p&gt;

&lt;p&gt;	/** @Field(type=&quot;string&quot;) */&lt;br/&gt;
	public $first_name;&lt;/p&gt;

&lt;p&gt;	/** @Field(type=&quot;string&quot;, name=&quot;last_name&quot;) */&lt;br/&gt;
	protected $_last_name;&lt;/p&gt;

&lt;p&gt;	public function __get($propertyName)&lt;br/&gt;
	{&lt;br/&gt;
		return $this-&amp;gt;&lt;/p&gt;
{&apos;_&apos;.$propertyName};&lt;br/&gt;
	}&lt;br/&gt;
&lt;br/&gt;
	public function __set($propertyName, $propertyValue)&lt;br/&gt;
	{&lt;br/&gt;
		$this-&amp;gt;{&apos;_&apos;.$propertyName}
&lt;p&gt; = $propertyValue;&lt;br/&gt;
	}&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;$doc = new MyDocument();&lt;br/&gt;
$doc-&amp;gt;first_name = &apos;aaa&apos;;&lt;br/&gt;
$doc-&amp;gt;last_name = &apos;bbb&apos;;&lt;br/&gt;
dm()-&amp;gt;persist($doc);&lt;br/&gt;
dm()-&amp;gt;flush();&lt;/p&gt;</description>
                <environment>CentOS 5.5, PHP 5.3</environment>
            <key id="12366">MODM-117</key>
            <summary>&quot;name&quot; attribute in @Field 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="5">Cannot Reproduce</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vkaplich">Vitaliy Kaplich</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Feb 2011 13:24:51 +0000</created>
                <updated>Fri, 11 Feb 2011 13:56:39 +0000</updated>
                    <resolved>Fri, 11 Feb 2011 13:56:39 +0000</resolved>
                            <version>1.0.0BETA1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15259" author="jwage" created="Fri, 11 Feb 2011 13:56:26 +0000"  >&lt;p&gt;I added a test here for your issue and it appears to be working properly in the latest master in git.&lt;/p&gt;

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

<item>
            <title>[MODM-115] Persisting a document which references another document drops ID</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-115</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;I have two documents:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;@Document&lt;br/&gt;
class A {&lt;br/&gt;
  /** @Id  */&lt;br/&gt;
  public $id;&lt;br/&gt;
  /** @ReferenceOne */&lt;br/&gt;
  public $b;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;@Document&lt;br/&gt;
class B {&lt;br/&gt;
  /** @Id */&lt;br/&gt;
  public $id;&lt;br/&gt;
}&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I have an already persisted instance of B, which A references,&lt;br/&gt;
though while persisting A and examining the resulting collection the id of B is missing.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;{&lt;br/&gt;
  _id: &apos;000123&apos;,&lt;br/&gt;
  b: {&lt;br/&gt;
    $db: &apos;mydb&apos;,&lt;br/&gt;
    $id: &apos;&apos;,&lt;br/&gt;
    $ref: &apos;b&apos;&lt;br/&gt;
  }&lt;br/&gt;
}&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I debugged the code and found the error occurs in &lt;b&gt;DocumentPersister.php at line 210&lt;/b&gt; in the latest git version as of this posting.&lt;br/&gt;
The code is:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;  $inserts&lt;span class=&quot;error&quot;&gt;&amp;#91;$oid&amp;#93;&lt;/span&gt; = $data;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;where &lt;b&gt;$data&lt;/b&gt; is:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;array&amp;#40;&lt;br/&gt;
  _id =&amp;gt; MongoId&amp;#40;000123&amp;#41;,&lt;br/&gt;
  b =&amp;gt; array&amp;#40;&lt;br/&gt;
    $ref =&amp;gt; &apos;b&apos;,&lt;br/&gt;
    $id =&amp;gt; MongoID&amp;#40;123000&amp;#41;,&lt;br/&gt;
    $db =&amp;gt; &apos;mydb&apos;&lt;br/&gt;
  &amp;#41;&lt;br/&gt;
&amp;#41;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;and &lt;b&gt;$inserts&lt;span class=&quot;error&quot;&gt;&amp;#91;$oid&amp;#93;&lt;/span&gt;&lt;/b&gt; becomes:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;array&amp;#40;&lt;br/&gt;
  $oid = array&amp;#40;&lt;br/&gt;
    _id =&amp;gt; MongoId&amp;#40;000123&amp;#41;,&lt;br/&gt;
    b =&amp;gt; array&amp;#40;&lt;br/&gt;
      $ref =&amp;gt; &apos;b&apos;,&lt;br/&gt;
      $id =&amp;gt; &lt;b&gt;MongoID&amp;#40;&amp;#41;&lt;/b&gt;,&lt;br/&gt;
      $db =&amp;gt; &apos;mydb&apos;&lt;br/&gt;
    &amp;#41;&lt;br/&gt;
  &amp;#41;&lt;br/&gt;
&amp;#41;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;This assignment makes the MongoID disappear somehow!!?&lt;/p&gt;

&lt;p&gt;Can&apos;t figure it out, could this be a problem with PHP itself?&lt;/p&gt;</description>
                <environment>Debian, PHP 5.3.3-7 Suhosin fcgi</environment>
            <key id="12354">MODM-115</key>
            <summary>Persisting a document which references another document drops ID</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="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="zybreak">Robert Knutsson</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Feb 2011 10:48:51 +0000</created>
                <updated>Thu, 3 Feb 2011 15:54:42 +0000</updated>
                    <resolved>Thu, 3 Feb 2011 15:54:42 +0000</resolved>
                            <version>1.0.0BETA2</version>
                                                <component>Persister</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15222" author="zybreak" created="Thu, 3 Feb 2011 15:54:42 +0000"  >&lt;p&gt;The problem occurred since i was dumping the class before it was initialized, not realizing that proxy classes lazy loaded.&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-108] Random hydratation problem</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-108</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;I have the following collection named Isboo_Item :&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
   &quot;_id&quot;: ObjectId(&quot;4d3d02fec9fa877d44a36978&quot;),&lt;br/&gt;
   &quot;author&quot;: null,&lt;br/&gt;
   &quot;backpack&quot;: null,&lt;br/&gt;
   &quot;itemType&quot;: 1,&lt;br/&gt;
   &quot;owner&quot;: &quot;4d3cf450b532519765080000&quot;,&lt;br/&gt;
   &quot;place&quot;: null,&lt;br/&gt;
   &quot;quality&quot;: null,&lt;br/&gt;
   &quot;quantity&quot;: 1,&lt;br/&gt;
   &quot;value&quot;: null &lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;I have a such PHP class :&lt;/p&gt;

&lt;p&gt;/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;@Document(db=&quot;Isboona&quot;, collection=&quot;Isboo_Item&quot;)&lt;/li&gt;
	&lt;li&gt;*/&lt;br/&gt;
class Isboo_Item extends Isboo_Db&lt;br/&gt;
{&lt;br/&gt;
(...)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;When I&apos;m trying :&lt;br/&gt;
$dm-&amp;gt;findOne($collection, array(&apos;_id&apos; =&amp;gt; $id));&lt;/p&gt;

&lt;p&gt;I get : &lt;/p&gt;

&lt;p&gt;Fatal error:  Uncaught exception &apos;ReflectionException&apos; with message &apos;Class 4 does not exist&apos; in /users/developpement/www/library/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php:285&lt;/p&gt;

&lt;p&gt;However the same works fine with another collection :&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
   &quot;_id&quot;: ObjectId(&quot;4d3cf450b532519765080000&quot;),&lt;br/&gt;
   &quot;characs&quot;: &lt;/p&gt;
{
     &quot;mana&quot;: 64,
     &quot;strenght&quot;: 83,
     &quot;agility&quot;: 69,
     &quot;dexterity&quot;: 88,
     &quot;constitution&quot;: 94,
     &quot;culture&quot;: 79,
     &quot;vivacity&quot;: 57,
     &quot;eloquence&quot;: 64,
     &quot;intellect&quot;: 74,
     &quot;willpower&quot;: 88,
     &quot;empathy&quot;: 96,
     &quot;charisma&quot;: 83 
  }
&lt;p&gt;,&lt;br/&gt;
   &quot;name&quot;: &quot;Krok&quot;,&lt;br/&gt;
   &quot;position&quot;: &lt;/p&gt;
{
     &quot;IDplace&quot;: 0,
     &quot;posX&quot;: 0,
     &quot;posY&quot;: 0,
     &quot;posLocalX&quot;: 0,
     &quot;posLocalY&quot;: 0 
  }
&lt;p&gt;,&lt;br/&gt;
   &quot;refFather&quot;: &lt;/p&gt;
{
     &quot;$ref&quot;: &quot;Isboo_Character&quot;,
     &quot;$id&quot;: ObjectId(&quot;4d3cf450b532519765090000&quot;),
     &quot;$db&quot;: &quot;Isboona&quot; 
  }
&lt;p&gt;,&lt;br/&gt;
   &quot;refMother&quot;: &lt;/p&gt;
{
     &quot;$ref&quot;: &quot;Isboo_Character&quot;,
     &quot;$id&quot;: ObjectId(&quot;4d3cf450b5325197650a0000&quot;),
     &quot;$db&quot;: &quot;Isboona&quot; 
  }
&lt;p&gt; &lt;br/&gt;
}&lt;/p&gt;</description>
                <environment>Mac OS X</environment>
            <key id="12321">MODM-108</key>
            <summary>Random hydratation problem</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="billybob">Billy Bob</reporter>
                        <labels>
                    </labels>
                <created>Sun, 23 Jan 2011 23:57:00 +0000</created>
                <updated>Tue, 25 Jan 2011 19:01:06 +0000</updated>
                    <resolved>Tue, 25 Jan 2011 19:01:06 +0000</resolved>
                            <version>1.0.0BETA1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </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-105] inversedBy as ORM</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-105</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;A way to specify &quot;inversedBy&quot; when mapping referenceOne and referenceMany as the ORM have it.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12283">MODM-105</key>
            <summary>inversedBy as ORM</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="henrikbjorn">Henrik Bjornskov</reporter>
                        <labels>
                    </labels>
                <created>Fri, 7 Jan 2011 07:58:02 +0000</created>
                <updated>Fri, 4 Mar 2011 10:33:47 +0000</updated>
                    <resolved>Fri, 4 Mar 2011 10:33:47 +0000</resolved>
                            <version>1.0.0BETA2</version>
                                <fixVersion>1.0.0BETA3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15270" author="jwage" created="Fri, 11 Feb 2011 15:55:09 +0000"  >&lt;p&gt;hmm. I am not sure if having inversedBy makes sense for the mongodb odm based on how references currently work. What would it be used for? relationships in the odm don&apos;t work like they do in the orm. We don&apos;t use foreign keys to get a reference, we store a reference document on the document that is doing the referencing.&lt;/p&gt;</comment>
                    <comment id="15344" author="jwage" created="Sat, 19 Feb 2011 18:24:31 +0000"  >&lt;p&gt;Thinking about this more:&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 */
class Product
{
    /** @ReferenceOne(targetDocument=&lt;span class=&quot;code-quote&quot;&gt;&quot;Seller&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $seller;
}

/** @Document */
class Seller
{
    /** @ReferenceMany(targetDocument=&lt;span class=&quot;code-quote&quot;&gt;&quot;Product&quot;&lt;/span&gt;, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;seller&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $products;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now the $products association will be loaded by running a query like 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;db.products.find({ &apos;seller.$id&apos; : seller.id })
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Is this what you mean?&lt;/p&gt;</comment>
                    <comment id="15352" author="henrikbjorn" created="Sun, 20 Feb 2011 07:47:37 +0000"  >&lt;p&gt;Sorry not getting back to you about this sooner. But that is exactly what i mean &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; can also be done for reference one i think &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="15353" author="jwage" created="Sun, 20 Feb 2011 12:41:38 +0000"  >&lt;p&gt;Can you help me think through the other scenariors where it can be used? and how mappedBy would be used. We just need to be sure to think through all the semantics and define it all before I start trying to implement it.&lt;/p&gt;</comment>
                    <comment id="15355" author="jwage" created="Sun, 20 Feb 2011 22:14:42 +0000"  >&lt;p&gt;I implemented this here &lt;a href=&quot;https://github.com/doctrine/mongodb-odm/commit/d1bffbd6bb7b7b690e25f1314f1bf6b69f1e41a6&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/mongodb-odm/commit/d1bffbd6bb7b7b690e25f1314f1bf6b69f1e41a6&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Can you check it out and give some feedback?&lt;/p&gt;</comment>
                    <comment id="15358" author="henrikbjorn" created="Mon, 21 Feb 2011 02:46:44 +0000"  >&lt;p&gt;Yes i will play around with it later today &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-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-104] Creating mongo configuration class instance hangs php</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-104</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;After pasting down the doc tutorial example I&apos;ve noticed that php hangs on &lt;br/&gt;
Configuration instance creation.&lt;/p&gt;

&lt;p&gt;require &apos;Doctrine/Common/ClassLoader.php&apos;;&lt;br/&gt;
use Doctrine\Common\ClassLoader,&lt;br/&gt;
    Doctrine\Common\Annotations\AnnotationReader,&lt;br/&gt;
    Doctrine\ODM\MongoDB\DocumentManager,&lt;br/&gt;
    Doctrine\ODM\MongoDB\Mongo,&lt;br/&gt;
    Doctrine\ODM\MongoDB\Configuration,&lt;br/&gt;
    Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver;&lt;br/&gt;
// ODM Classes&lt;br/&gt;
$classLoader = new ClassLoader(&apos;Doctrine\ODM&apos;, &apos;mongodb_odm/lib&apos;);&lt;br/&gt;
$classLoader-&amp;gt;register();&lt;br/&gt;
// Common Classes&lt;br/&gt;
$classLoader = new ClassLoader(&apos;Doctrine\Common&apos;, &apos;mongodb_odm/lib/vendor/doctrine-common/lib&apos;);&lt;br/&gt;
$classLoader-&amp;gt;register();&lt;br/&gt;
// Document classes&lt;br/&gt;
$classLoader = new ClassLoader(&apos;Documents&apos;, _&lt;em&gt;DIR&lt;/em&gt;_);&lt;br/&gt;
$classLoader-&amp;gt;register();&lt;/p&gt;

&lt;p&gt;//-------hangs here&lt;br/&gt;
$config = new Configuration();&lt;/p&gt;

&lt;p&gt;//tried explicit too &lt;br/&gt;
// new Doctrine\ODM\MongoDB\Configuration();&lt;/p&gt;

&lt;p&gt;No errors or warnigs of any kind generated.&lt;/p&gt;</description>
                <environment>Ubuntu 10.4, PHP 5.3.3, MongoDB 1.6.5, doctrinemongoODM installed with PEAR, also present Doctrine 1.2.3, php handling installed via pecl</environment>
            <key id="12244">MODM-104</key>
            <summary>Creating mongo configuration class instance hangs php</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="5">Cannot Reproduce</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="pejot">Peter Jasiulewicz</reporter>
                        <labels>
                    </labels>
                <created>Tue, 21 Dec 2010 18:25:08 +0000</created>
                <updated>Fri, 11 Feb 2011 15:55:33 +0000</updated>
                    <resolved>Fri, 11 Feb 2011 15:55:33 +0000</resolved>
                            <version>1.0.0BETA1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15000" author="jwage" created="Thu, 23 Dec 2010 14:22:55 +0000"  >&lt;p&gt;Hmm, I am not sure this is a problem with any code or anything in the odm, but something wrong with your environment maybe?&lt;/p&gt;</comment>
                    <comment id="15014" author="pejot" created="Fri, 24 Dec 2010 08:32:27 +0000"  >&lt;p&gt;No reason why it would hang on a simple object constucting. I&apos;m using the box for development for a while now, Doctrine 1.2.3 installd too.&lt;br/&gt;
Will try to change the box after Xmas.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-102] Documents which belong to global namespace can not be handled?</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-102</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;I&apos;m using xml files to store documents annotations. &lt;br/&gt;
All my documents are in global namespace.&lt;/p&gt;

&lt;p&gt;So lets say I created the following configuration file:&lt;/p&gt;

&lt;p&gt;.Blackboard_Page.dcm.xml&lt;/p&gt;

&lt;p&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br/&gt;
&amp;lt;doctrine-mongo-mapping xmlns=&quot;http://doctrine-project.org/schemas/orm/doctrine-mongo-mapping&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://doctrine-project.org/schemas/orm/doctrine-mongo-mapping.xsd&quot;&amp;gt;&lt;br/&gt;
	&amp;lt;document name=&quot;\Blackboard_Page&quot; collection=&quot;blackboard.pages&quot;&amp;gt;&lt;br/&gt;
		&amp;lt;field fieldName=&quot;_id&quot; name=&quot;_id&quot; id=&quot;true&quot;/&amp;gt;&lt;br/&gt;
		...&lt;br/&gt;
	&amp;lt;/document&amp;gt;&lt;br/&gt;
&amp;lt;/doctrine-mongo-mapping&amp;gt;&lt;/p&gt;

&lt;p&gt;When I try to get the document using the following code:&lt;/p&gt;

&lt;p&gt;foreach($dm-&amp;gt;createQueryBuilder(&quot;\Blackboard_Page&quot;)...&lt;del&gt;&amp;gt;getQuery()&lt;/del&gt;&amp;gt;execute() as $page) {}&lt;/p&gt;

&lt;p&gt;it fails with Exception &quot;Doctrine\ODM\MongoDB\MongoDBException: No identifier/primary key specified for Document &apos;Blackboard_Page&apos;. Every Document must have an identifier/primary key.&quot;&lt;/p&gt;

&lt;p&gt;The reason of the problem is behavior of the function &quot;get_class&quot;.&lt;br/&gt;
See mongodb_odm\lib\Doctrine\ODM\MongoDB\Hydrator.php line 122:&lt;br/&gt;
$metadata = $this-&amp;gt;dm-&amp;gt;getClassMetadata(get_class($document));&lt;br/&gt;
for details.&lt;/p&gt;

&lt;p&gt;When the code pass an instance of the document which belongs to global namespace the function &quot;get_class()&quot; returns class name without &quot;\&quot; prefix&lt;br/&gt;
and AbstractFileDriver-&amp;gt;findMappingFile convert such class name into file name without leading dot (&quot;.&quot;)  (something like &quot;Blackboard_Page.dcm.xml&quot; instead of &quot;.Blackboard_Page.dcm.xml&quot;).&lt;br/&gt;
And it causes the exception.&lt;/p&gt;

&lt;p&gt;Patching of the method &quot;AbstractFileDriver-&amp;gt;findMappingFile&quot; does not help. &lt;br/&gt;
The problem is more complicated than it looks like because get_class() is used in a lot of places in the code.&lt;/p&gt;









</description>
                <environment>CentOS 5.5, PHP 5.3.3</environment>
            <key id="12237">MODM-102</key>
            <summary>Documents which belong to global namespace can not be handled?</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="5">Cannot Reproduce</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vkaplich">Vitaliy Kaplich</reporter>
                        <labels>
                    </labels>
                <created>Thu, 16 Dec 2010 14:39:03 +0000</created>
                <updated>Fri, 11 Feb 2011 15:56:30 +0000</updated>
                    <resolved>Fri, 11 Feb 2011 15:56:30 +0000</resolved>
                            <version>1.0.0BETA2</version>
                                                <component>Hydration</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14987" author="jwage" created="Mon, 20 Dec 2010 16:10:25 +0000"  >&lt;p&gt;When you omit the starting \ does that help? I don&apos;t think you need to include it.&lt;/p&gt;</comment>
                    <comment id="14992" author="vkaplich" created="Tue, 21 Dec 2010 15:41:27 +0000"  >&lt;p&gt;Ok. I&apos;ll keep in mind and try later when it become possible and let you know about the result.&lt;/p&gt;

&lt;p&gt;&amp;gt; I don&apos;t think you need to include it.&lt;/p&gt;

&lt;p&gt;Unfortunately right now I just can not check it.&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-160] Errors when merging new documents with two levels of embedded documents</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-160</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;There&apos;s two different error messages that can be found from this.&lt;/p&gt;

&lt;p&gt;If it&apos;s EmbedMany in an array (not an ArrayCollection), the following error message results:&lt;/p&gt;

&lt;p&gt;Argument 1 passed to Doctrine\ODM\MongoDB\PersistentCollection::__construct() must implement interface Doctrine\Common\Collections\Collection, array given, called in mongodb-odm/lib/Doctrine/ODM/MongoDB/UnitOfWork.php on line 1830 and defined&lt;/p&gt;

&lt;p&gt;Otherwise it&apos;s:&lt;/p&gt;

&lt;p&gt;Undefined index: &amp;lt;blank&amp;gt;&lt;/p&gt;

&lt;p&gt;Failing tests have been created and a PR has been submitted on GitHub: &lt;a href=&quot;https://github.com/doctrine/mongodb-odm/pull/230&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/mongodb-odm/pull/230&lt;/a&gt;&lt;/p&gt;</description>
                <environment>Mac OS X 10.7, All code is the latest version of master.</environment>
            <key id="13352">MODM-160</key>
            <summary>Errors when merging new documents with two levels of 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="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="magnusnordlander">Magnus Nordlander</reporter>
                        <labels>
                    </labels>
                <created>Wed, 11 Jan 2012 09:14:28 +0000</created>
                <updated>Sat, 4 Feb 2012 23:50:33 +0000</updated>
                    <resolved>Sat, 4 Feb 2012 23:50:33 +0000</resolved>
                                                            <component>UnitOfWork</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17368" author="jwage" created="Sat, 4 Feb 2012 23:50:33 +0000"  >&lt;p&gt;Fixed here &lt;a href=&quot;https://github.com/doctrine/mongodb-odm/commit/3aca4495eab4fa5e4b6b0034d31dfe37b8f27f70&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/mongodb-odm/commit/3aca4495eab4fa5e4b6b0034d31dfe37b8f27f70&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-166] recomputeSingleDocumentChangeSet does not work for collections</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-166</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;If you have a document with a collection, during computation of the changeSet before persist a reference to that collection is placed in originalData, not a copy. Therefore, if you change the collection in an onFlush event listener, then call recomputeSingleDocumentChangeSet, the changes to the collection are not recognised, because the originalData has changed also.&lt;/p&gt;

&lt;p&gt;I will create a test, and hopefully fix for this soon.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13799">MODM-166</key>
            <summary>recomputeSingleDocumentChangeSet does not work for collections</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="superdweebie">Tim Roediger</reporter>
                        <labels>
                    </labels>
                <created>Sun, 24 Jun 2012 22:41:35 +0000</created>
                <updated>Wed, 27 Jun 2012 22:04:51 +0000</updated>
                    <resolved>Wed, 27 Jun 2012 22:04:51 +0000</resolved>
                                                            <component>UnitOfWork</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="18145" author="superdweebie" created="Tue, 26 Jun 2012 22:31:15 +0000"  >&lt;p&gt;PR open with fix &lt;a href=&quot;https://github.com/doctrine/mongodb-odm/pull/336&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/mongodb-odm/pull/336&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="18150" author="superdweebie" created="Wed, 27 Jun 2012 22:04:51 +0000"  >&lt;p&gt;PR merged&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-165] Identity map doesn&apos;t work (tested only with Symfony) </title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-165</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;I tested a basic find (by id) query in Symfony and it seems that the identity map feature does not work.&lt;br/&gt;
here the code: &lt;a href=&quot;https://gist.github.com/2431505&quot; class=&quot;external-link&quot;&gt;https://gist.github.com/2431505&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4 query with a default Doctrine ODM/Symfony configuration give me 4 query in mongostat.&lt;/p&gt;</description>
                <environment>mongodb version 2.0.2, mac os x lion, Symfony master</environment>
            <key id="13653">MODM-165</key>
            <summary>Identity map doesn&apos;t work (tested only with Symfony) </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="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ludofleury">Ludovic</reporter>
                        <labels>
                    </labels>
                <created>Fri, 20 Apr 2012 20:23:48 +0000</created>
                <updated>Fri, 20 Apr 2012 23:25:29 +0000</updated>
                    <resolved>Fri, 20 Apr 2012 23:25:13 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="17876" author="ludofleury" created="Fri, 20 Apr 2012 23:25:13 +0000"  >&lt;p&gt;I misunderstood the identity map usage, actually I discover in the code that it was strictly restricted to find() method and the load method didn&apos;t fetch from the identityMap (even if the query carry only an id criteria). I&apos;m not sure of all impact, but I think it could be quite easy to fix this. I&apos;ll try to open an issue and maybe to PR. Thanks.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-133] array keys with dots aren&apos;t persisted for Hash field</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-133</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;array keys with dots aren&apos;t persisted for Hash field&lt;/p&gt;

&lt;p&gt;in the attachment you will find a complete testcase.&lt;/p&gt;

&lt;p&gt;thanks.&lt;/p&gt;




&lt;p&gt;EDIT: use the second attachment&lt;/p&gt;</description>
                <environment>Macosx</environment>
            <key id="12484">MODM-133</key>
            <summary>array keys with dots aren&apos;t persisted for Hash field</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="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gordonslondon">jules b</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Mar 2011 18:27:02 +0000</created>
                <updated>Mon, 11 Apr 2011 18:50:50 +0000</updated>
                    <resolved>Mon, 11 Apr 2011 18:50:30 +0000</resolved>
                            <version>1.0.0BETA3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15722" author="gordonslondon" created="Mon, 11 Apr 2011 18:50:30 +0000"  >&lt;p&gt;it seems that mongodb doesn&apos;t allow dots in keys.&lt;br/&gt;
&lt;a href=&quot;http://shift8creative.com/blog/creating-a-simple-and-efficient-rating-system-with-mongodb&quot; class=&quot;external-link&quot;&gt;http://shift8creative.com/blog/creating-a-simple-and-efficient-rating-system-with-mongodb&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10960" name="MODM133.zip" size="4062" author="gordonslondon" created="Thu, 24 Mar 2011 14:05:58 +0000" />
                    <attachment id="10959" name="MODM133.zip" size="4080" author="gordonslondon" created="Thu, 24 Mar 2011 14:00:33 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-8] custom repositories don&apos;t work when  setting MetadataCacheImpl</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-8</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;When I enable metadataCache:&lt;/p&gt;

&lt;p&gt;$config-&amp;gt;setMetadataCacheImpl(new \Doctrine\Common\Cache\ApcCache());&lt;/p&gt;

&lt;p&gt;My custom repository stops working. For I example I have a method findAllAssoc.&lt;br/&gt;
witout enabling metadata cache it works fine.&lt;/p&gt;

&lt;p&gt;Fatal error: Uncaught exception &apos;BadMethodCallException&apos; with message &apos;Undefined method &apos;findAllAssoc&apos;. The method name must start with either findBy or findOneBy!&apos; in /data/sites/mongodb_odm/lib/Doctrine/ODM/MongoDB/DocumentRepository.php:197&lt;br/&gt;
Stack trace:&lt;br/&gt;
#0 &lt;span class=&quot;error&quot;&gt;&amp;#91;internal function&amp;#93;&lt;/span&gt;: Doctrine\ODM\MongoDB\DocumentRepository-&amp;gt;__call(&apos;findAllAssoc&apos;, Array)&lt;br/&gt;
#1 /data/sites/cms.enkorting.nl/application/modules/user/controllers/IndexController.php(72): Doctrine\ODM\MongoDB\DocumentRepository-&amp;gt;findAllAssoc()&lt;/p&gt;

&lt;p&gt;Cheers, Onno&lt;/p&gt;</description>
                <environment></environment>
            <key id="11402">MODM-8</key>
            <summary>custom repositories don&apos;t work when  setting MetadataCacheImpl</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="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="oschmidt">Onno Schmidt</reporter>
                        <labels>
                    </labels>
                <created>Sat, 22 May 2010 11:56:58 +0000</created>
                <updated>Mon, 2 Aug 2010 17:27:24 +0000</updated>
                    <resolved>Thu, 3 Jun 2010 18:57:13 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                                <fixVersion>1.0.0ALPHA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13097" author="jwage" created="Thu, 3 Jun 2010 18:57:13 +0000"  >&lt;p&gt;When you enable your metadata cache, it is pulling your mapping information from the cache instead of from your files. So it is probably pulling an older version that does not have the customRepositoryClassName property populated. Clear your metadata cache and it should work fine.&lt;/p&gt;</comment>
                    <comment id="13760" author="oschmidt" created="Mon, 2 Aug 2010 17:27:24 +0000"  >&lt;p&gt;Somehow, I am still not able to get this to work. Even when I clear the cache I get the message that my custom methods can&apos;t be found. I will try to create reproducible case.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-7] Fatal error when using a custom repository class in AnnotationDriver</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-7</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;When defining a custom repository in an annotation the AnnotationDriver gives an Fatal error on line 105&lt;/p&gt;

&lt;p&gt;Call to a member function setCustomRepositoryClass() on a non-object in /data/sites/lib/Doctrine/ODM/MongoDB/Mapping/Driver/AnnotationDriver.php on line 105 &lt;/p&gt;

&lt;p&gt;replacing:&lt;br/&gt;
$metadata-&amp;gt;setCustomRepositoryClass($documentAnnot-&amp;gt;repositoryClass);&lt;/p&gt;

&lt;p&gt;for:&lt;br/&gt;
$class-&amp;gt;setCustomRepositoryClass($documentAnnot-&amp;gt;repositoryClass);&lt;/p&gt;

&lt;p&gt;solves this issue..&lt;br/&gt;
Cheers, Onno&lt;/p&gt;</description>
                <environment></environment>
            <key id="11374">MODM-7</key>
            <summary>Fatal error when using a custom repository class in AnnotationDriver</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="oschmidt">Onno Schmidt</reporter>
                        <labels>
                    </labels>
                <created>Sun, 16 May 2010 15:49:55 +0000</created>
                <updated>Wed, 9 Jun 2010 19:50:01 +0000</updated>
                    <resolved>Thu, 20 May 2010 18:05:33 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                                <fixVersion>1.0.0ALPHA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-5] Make embedding work on objects in a collection inheritance tree</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-5</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;&lt;a href=&quot;https://gist.github.com/72a8e30931eb56dd84bc&quot; class=&quot;external-link&quot;&gt;https://gist.github.com/72a8e30931eb56dd84bc&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="11361">MODM-5</key>
            <summary>Make embedding work on objects in a collection inheritance tree</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="avalanche123">Bulat Shakirzyanov</reporter>
                        <labels>
                    </labels>
                <created>Fri, 14 May 2010 11:23:47 +0000</created>
                <updated>Wed, 9 Jun 2010 19:49:27 +0000</updated>
                    <resolved>Sat, 29 May 2010 12:41:05 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                                <fixVersion>1.0.0ALPHA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13030" author="jwage" created="Thu, 20 May 2010 18:07:31 +0000"  >&lt;p&gt;Can you make a Doctrine test case that I can run more easily? and maybe some information about the issue? &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-4] tweak xml/yml syntax</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-4</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;15:00&amp;#93;&lt;/span&gt; &amp;lt;jwage&amp;gt; we need to write the schema file for the xml&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;15:00&amp;#93;&lt;/span&gt; &amp;lt;jwage&amp;gt; and maybe expand the xml and yaml syntax&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;15:00&amp;#93;&lt;/span&gt; &amp;lt;jwage&amp;gt; to have &amp;lt;reference&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;15:00&amp;#93;&lt;/span&gt; &amp;lt;jwage&amp;gt; &amp;lt;embedded&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;15:00&amp;#93;&lt;/span&gt; &amp;lt;jwage&amp;gt; etc&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;15:00&amp;#93;&lt;/span&gt; &amp;lt;avalanche123&amp;gt; ah, I see, to make it more like ORM?&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;15:01&amp;#93;&lt;/span&gt; &amp;lt;jwage&amp;gt; i think so&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;15:01&amp;#93;&lt;/span&gt; &amp;lt;jwage&amp;gt; it&apos;s just better &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;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;15:01&amp;#93;&lt;/span&gt; &amp;lt;jwage&amp;gt; you dont have to specify embedded=true&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;15:01&amp;#93;&lt;/span&gt; &amp;lt;avalanche123&amp;gt; right&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;15:01&amp;#93;&lt;/span&gt; &amp;lt;jwage&amp;gt; when reading in the &amp;lt;embedded you will just set that&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;15:01&amp;#93;&lt;/span&gt; &amp;lt;jwage&amp;gt; in the array&lt;/p&gt;</description>
                <environment></environment>
            <key id="11347">MODM-4</key>
            <summary>tweak xml/yml syntax</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</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, 11 May 2010 15:06:17 +0000</created>
                <updated>Wed, 9 Jun 2010 19:48:57 +0000</updated>
                    <resolved>Wed, 12 May 2010 12:54:22 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                                <fixVersion>1.0.0ALPHA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12928" author="avalanche123" created="Wed, 12 May 2010 12:54:22 +0000"  >&lt;p&gt;fixed it yesterday&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-1] Using Doctrine\Common\Collections\Collection</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-1</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Collections of objects in mongodb entities/documents should be handled like in the ORM through the Common collections.&lt;br/&gt;
This makes it possible to use similar transparent lazy-loading strategies, without $em-&amp;gt;loadEntityAssociations which is contrary to the idea of transparent persistence.&lt;br/&gt;
Also this would make mongo entities/documents compatible with orm/relational entities, that is, using the same class(es) as a mongo and orm entity.&lt;/p&gt;

&lt;p&gt;This goes for other potential upcoming projects, like couchdb, too. We should always encourage the use of the Doctrine Common collections in domain models.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11297">MODM-1</key>
            <summary>Using Doctrine\Common\Collections\Collection</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</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="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Apr 2010 05:51:39 +0000</created>
                <updated>Wed, 9 Jun 2010 19:47:41 +0000</updated>
                    <resolved>Tue, 11 May 2010 15:04:02 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                                <fixVersion>1.0.0ALPHA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12800" author="jwage" created="Fri, 30 Apr 2010 14:49:12 +0000"  >&lt;p&gt;I implemented the base usage of the Collection stuff instead of php arrays. I will need your input on the best way to eliminate the loadEntityAssociation(s)() stuff and do something more transparent.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-2] Reconsider the naming</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-2</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;We may want to reconsider the naming of things in ODM projects. I know the term &quot;entity&quot; is heavily overloaded but I think there might be a misunderstanding here of what @Entity refers to in the ORM. The ORM @Entity actually means a (relational) database entity (entity relationship diagram, etc...) not the &quot;DDD&quot; entity, of course there are many similarities.&lt;/p&gt;

&lt;p&gt;I don&apos;t feel that comfortable with the possibility of half a dozen different &quot;EntityManager&quot;s, especially if they represent entirely different storage paradigms.&lt;/p&gt;

&lt;p&gt;Remember, @Entity does not really mean &quot;DDD entity&quot;. An EntityManager is not a &quot;DDD entity manager&quot; &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; It is part of the infrastructure (persistence), not of the domain model.&lt;/p&gt;

&lt;p&gt;Do we want X different &quot;EntityManager&quot;s? When considering that @Entity actually refers to a relational database entity, it would make more sense to call these things @Document in the ODM projects, since that is what they&apos;re stored as. Then we could instead use the term DocumentManager, and not EntityManager for the ODM projects.&lt;/p&gt;

&lt;p&gt;I realize that this confusion comes from the fact that many think &quot;entity&quot; = &quot;DDD entity&quot; but that is not the case. @Entity in the ORM refers to a relational database entity just like @Column refers to a relational database column.&lt;/p&gt;

&lt;p&gt;So my vote currently absolutely goes for @Document and DocumentManager to keep things consistent. Of course, a mongo and a couch project can both have a DocumentManager, that is fine, both storage paradigms are documents.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11298">MODM-2</key>
            <summary>Reconsider the naming</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</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="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Apr 2010 06:05:18 +0000</created>
                <updated>Wed, 9 Jun 2010 19:48:14 +0000</updated>
                    <resolved>Fri, 30 Apr 2010 13:38:11 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                                <fixVersion>1.0.0ALPHA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12799" author="jwage" created="Fri, 30 Apr 2010 13:38:11 +0000"  >&lt;p&gt;Agreed. This is great to have you here to provide this kind of valuable input! &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-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-60] Need a way to find all documents from collection by their base class</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-60</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Imagine a use case:&lt;/p&gt;

&lt;p&gt;I have a set of classes, which extend abstract class BaseGridFsFile. All children classess are stored in same GridFs collection (using single collection inheritance).&lt;/p&gt;

&lt;p&gt;But I cannot fetch all files from this collection, regardless their type. I know that I can use array of subclasses to fetch, but this won&apos;t work in my case, because there is no static DiscriminatorMap.&lt;/p&gt;

&lt;p&gt;It whould be great if I could use something like 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;$files = $dm-&amp;gt;find(&apos;BaseGridFsFile&apos;, $query);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and Doctrine would instantiate proper classes for found documents.&lt;/p&gt;

&lt;p&gt;Is it possible?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11829">MODM-60</key>
            <summary>Need a way to find all documents from collection by their base class</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="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vladar">Vladimir Razuvaev</reporter>
                        <labels>
                    </labels>
                <created>Thu, 26 Aug 2010 08:10:50 +0000</created>
                <updated>Tue, 31 Aug 2010 05:17:55 +0000</updated>
                    <resolved>Mon, 30 Aug 2010 15:11:43 +0000</resolved>
                                                            <component>Document Manager</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14097" author="jwage" created="Thu, 26 Aug 2010 21:54:38 +0000"  >&lt;p&gt;It is possible if you have a none abstract parent class that all other subclasses extend from. If you query that class the queries will include a $in query limiting the results to itself and all subclasses using the discriminator values.&lt;/p&gt;</comment>
                    <comment id="14098" author="jwage" created="Thu, 26 Aug 2010 22:00:28 +0000"  >&lt;p&gt;Actually it should work even if it is abstract. It just must be a mapped document that has a discriminatorMap specified.&lt;/p&gt;</comment>
                    <comment id="14171" author="jwage" created="Mon, 30 Aug 2010 15:11:43 +0000"  >&lt;p&gt;This should work. You can ask usage questions on the mailing list and open an issue for bugs or enhancements.&lt;/p&gt;</comment>
                    <comment id="14189" author="vladar" created="Tue, 31 Aug 2010 05:17:55 +0000"  >&lt;p&gt;Yes, I checked. it works for non-abstract classes, with condition that queried class is in DiscriminatorMap for given collection.&lt;/p&gt;

&lt;p&gt;But it forces me to rework classes hierarchy to be able to use this feature. I think it would be great to have it work with abstract classes in future versions of ODM.&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-53] Problems with querying referenced elements</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-53</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;When trying to query embedded objects, I can use this syntax:&lt;/p&gt;

&lt;p&gt;object.value = &quot;asd&quot;&lt;/p&gt;

&lt;p&gt;but when I reference a different collections object, this would give me no result.&lt;/p&gt;

&lt;p&gt;However, according to &lt;a href=&quot;http://www.mongodb.org/display/DOCS/Schema+Design#SchemaDesign-Embedvs.Reference&quot; class=&quot;external-link&quot;&gt;http://www.mongodb.org/display/DOCS/Schema+Design#SchemaDesign-Embedvs.Reference&lt;/a&gt; this should work the same way.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11797">MODM-53</key>
            <summary>Problems with querying referenced elements</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="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="sebastian.hoitz">Sebastian Hoitz</reporter>
                        <labels>
                    </labels>
                <created>Wed, 18 Aug 2010 12:55:50 +0000</created>
                <updated>Sat, 19 Feb 2011 18:28:24 +0000</updated>
                    <resolved>Wed, 18 Aug 2010 13:49:47 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14007" author="jwage" created="Wed, 18 Aug 2010 13:17:23 +0000"  >&lt;p&gt;Can you be more specific what your issue? I can&apos;t quite understand what you mean. If you are asking if you can query a referenced document like you can an embedded document, the answer is no.&lt;/p&gt;

&lt;p&gt;i.e. if you have a document like 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;array(&apos;username&apos; =&amp;gt; &apos;jwage&apos;, &apos;profile&apos; =&amp;gt; array(...dbref....))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can&apos;t query something like &quot;profile.someFieldName&quot; which exists on the referenced document.&lt;/p&gt;</comment>
                    <comment id="14008" author="sebastian.hoitz" created="Wed, 18 Aug 2010 13:34:30 +0000"  >&lt;p&gt;But is this a limitation of Doctrine ODM or of MongoDB?&lt;/p&gt;

&lt;p&gt;Could there be a work-around for this issue? I can see quite a lot of cases where this might be important to do.&lt;/p&gt;</comment>
                    <comment id="14009" author="jwage" created="Wed, 18 Aug 2010 13:49:08 +0000"  >&lt;p&gt;It is the way MongoDB works, you have to think about how this is actually being stored and how the dot annotation works for querying. It only works with embedded documents, and the fields of the referenced document aren&apos;t embedded, they live somewhere else on another collection and the data is loaded in PHP with another query to mongo.&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-49] Getting PHP notice and warning with empty persistent collection</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-49</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;If there is an object with empty collection, e.g.:&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;4c6a11810f9d503c03000000&quot;&lt;/span&gt;,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;b&quot;&lt;/span&gt;: [
  ]
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then following code produces notice and warning:&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;persist&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $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;
}

$a = $dm-&amp;gt;loadByID(&apos;a&apos;, &apos;4c6a11810f9d503c03000000&apos;);
echo count($a-&amp;gt;getB()); &lt;span class=&quot;code-comment&quot;&gt;// produces notice and warning&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Notice and warning text:&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;Notice: Undefined variable: groupedIds in library\Doctrine\ODM\MongoDB\PersistentCollection.php on line 122

Warning: Invalid argument supplied &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; foreach() in library\Doctrine\ODM\MongoDB\PersistentCollection.php on line 122
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11782">MODM-49</key>
            <summary>Getting PHP notice and warning with empty persistent 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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vladar">Vladimir Razuvaev</reporter>
                        <labels>
                    </labels>
                <created>Tue, 17 Aug 2010 00:45:22 +0000</created>
                <updated>Tue, 17 Aug 2010 17:16:52 +0000</updated>
                    <resolved>Tue, 17 Aug 2010 17:16:52 +0000</resolved>
                                            <fixVersion>1.0.0BETA1</fixVersion>
                                <component>Collections</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13988" author="jwage" created="Tue, 17 Aug 2010 17:16:52 +0000"  >&lt;p&gt;This is fixed now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-50] GridFs file classes don&apos;t support inheritance</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-50</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;GridFs files do not support inheritance anymore. This issue only appeared after latest updates from git. It was working before.&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;files&quot;&lt;/span&gt;, db=&lt;span class=&quot;code-quote&quot;&gt;&quot;tests&quot;&lt;/span&gt;)
 * @InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;SINGLE_COLLECTION&quot;&lt;/span&gt;)
 * @DiscriminatorField(fieldName=&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;)
 * @DiscriminatorMap({
 *      &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;image&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;image&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($file) {$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;file = $file;}
}

/** @Document(collection=&lt;span class=&quot;code-quote&quot;&gt;&quot;files&quot;&lt;/span&gt;, db=&lt;span class=&quot;code-quote&quot;&gt;&quot;tests&quot;&lt;/span&gt;) */
class image &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; file
{
    /** @File */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $file;
}

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

&lt;p&gt;This code creates document in regular collection &quot;files&quot; instead of GridFs collection.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11786">MODM-50</key>
            <summary>GridFs file classes don&apos;t support inheritance</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, 17 Aug 2010 08:39:29 +0000</created>
                <updated>Tue, 17 Aug 2010 23:57:45 +0000</updated>
                    <resolved>Tue, 17 Aug 2010 20:33:17 +0000</resolved>
                                            <fixVersion>1.0.0BETA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13991" author="jwage" created="Tue, 17 Aug 2010 20:33:17 +0000"  >&lt;p&gt;Thanks for the issue! Fixed by &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/3830635986a288235c46e198b7170d959ce37647&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/3830635986a288235c46e198b7170d959ce37647&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13992" author="vladar" created="Tue, 17 Aug 2010 23:57:45 +0000"  >&lt;p&gt;Thanks for quick fixes! &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;

&lt;p&gt;I also found other weird issue, will create separate case for it.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-47] @AlsoLoad annotation, used on method causes fatal error</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-47</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Getting following errors when using @AlsoLoad annotation on method:&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;Notice: Undefined index: isCascadePersist in library\Doctrine\ODM\MongoDB\UnitOfWork.php on line 1661

Notice: Undefined index: fieldName in library\Doctrine\ODM\MongoDB\UnitOfWork.php on line 362

Notice: Undefined index: in library\Doctrine\ODM\MongoDB\Mapping\ClassMetadata.php on line 923

Fatal error: Call to a member function getValue() on a non-object in library\Doctrine\ODM\MongoDB\Mapping\ClassMetadata.php on line 923
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;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;

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

    /** @AlsoLoad(&lt;span class=&quot;code-quote&quot;&gt;&quot;c&quot;&lt;/span&gt;) */
    function renameC($c) {$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;b = $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;}
}

$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;getUnitOfWork()-&amp;gt;clear();

$a = $dm-&amp;gt;loadByID(&apos;a&apos;, $a-&amp;gt;getId());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11777">MODM-47</key>
            <summary>@AlsoLoad annotation, used on method causes fatal error</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>Mon, 16 Aug 2010 09:24:12 +0000</created>
                <updated>Tue, 17 Aug 2010 17:15:27 +0000</updated>
                    <resolved>Tue, 17 Aug 2010 17:15:27 +0000</resolved>
                                            <fixVersion>1.0.0BETA1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13987" author="jwage" created="Tue, 17 Aug 2010 17:15:27 +0000"  >&lt;p&gt;Thanks for all the issues &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;

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

<item>
            <title>[MODM-45] Doctrine doesn&apos;t persist empty objects</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-45</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Doctrine won&apos;t persist object if it is empty (all fields are nulls). Not sure if it is bug or expected behavior, but sometimes it causes inconvenience. 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;

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

$a = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; a();
$dm-&amp;gt;persist($a);
$dm-&amp;gt;flush(); &lt;span class=&quot;code-comment&quot;&gt;// $a won&apos;t be inserted&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;There is also related issue: when embedding empty object (all fields are nulls) embedded object is not saved.&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;

    /** @&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;WorkaroundToBeSaved&apos;;

    /** @EmbedOne(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 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 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;}
    function setB($b) {$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;b = $b;}
}

/** @EmbeddedDocument */
class b
{
    /** @&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 setVal($val) {$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;val = $val;}
    function getVal() {&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;}
}

$a = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; a();
$a-&amp;gt;setB(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; b());

$dm-&amp;gt;persist($a);
$dm-&amp;gt;flush();
$dm-&amp;gt;getUnitOfWork()-&amp;gt;clear();

$a = $dm-&amp;gt;loadByID(&apos;a&apos;, $a-&amp;gt;getId());
$c = (&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; !== $a-&amp;gt;getB()); 
var_dump($c); &lt;span class=&quot;code-comment&quot;&gt;// returns &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;, &lt;span class=&quot;code-keyword&quot;&gt;while&lt;/span&gt; expecting &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11775">MODM-45</key>
            <summary>Doctrine doesn&apos;t persist empty 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="vladar">Vladimir Razuvaev</reporter>
                        <labels>
                    </labels>
                <created>Mon, 16 Aug 2010 08:40:28 +0000</created>
                <updated>Tue, 17 Aug 2010 15:49:32 +0000</updated>
                    <resolved>Tue, 17 Aug 2010 15:49:32 +0000</resolved>
                                            <fixVersion>1.0.0BETA1</fixVersion>
                                <component>Persister</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13966" author="jwage" created="Mon, 16 Aug 2010 13:41:37 +0000"  >&lt;p&gt;Mongo won&apos;t let you insert empty documents, so we can&apos;t allow it.&lt;/p&gt;</comment>
                    <comment id="13967" author="jwage" created="Mon, 16 Aug 2010 13:43:09 +0000"  >&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;$mongo = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Mongo();
$doc = array();
$mongo-&amp;gt;dbname-&amp;gt;coll-&amp;gt;insert($doc);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Causes this error:&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;PHP Fatal error:  Uncaught exception &apos;MongoException&apos; with message &apos;no elements in doc&apos; in /Users/jwage/Sites/mongodb-odm/test.php:5
Stack trace:
#0 /Users/jwage/Sites/mongodb-odm/test.php(5): MongoCollection-&amp;gt;insert(Array)
#1 {main}
  thrown in /Users/jwage/Sites/mongodb-odm/test.php on line 5

MongoException: no elements in doc in /Users/jwage/Sites/mongodb-odm/test.php on line 5

Call Stack:
    0.0004     320216   1. {main}() /Users/jwage/Sites/mongodb-odm/test.php:0
    0.0037     322036   2. MongoCollection-&amp;gt;insert() /Users/jwage/Sites/mongodb-odm/test.php:5
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13969" author="vladar" created="Mon, 16 Aug 2010 23:24:46 +0000"  >&lt;p&gt;I see now. But second case is still possible with mongo and not supported by ODM:&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;$a = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; a();
$a-&amp;gt;setB(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; b());
$dm-&amp;gt;persist($a);
$dm-&amp;gt;flush($a);

/* expecting:
{
  &lt;span class=&quot;code-quote&quot;&gt;&quot;_id&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;4c69ff3c0f9d50c80e000000&quot;&lt;/span&gt;,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;tmp&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;WorkaroundToBeSaved&quot;&lt;/span&gt;,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;b&quot;&lt;/span&gt; =&amp;gt; []
}

* getting:
{
  &lt;span class=&quot;code-quote&quot;&gt;&quot;_id&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;4c69ff3c0f9d50c80e000000&quot;&lt;/span&gt;,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;tmp&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;WorkaroundToBeSaved&quot;&lt;/span&gt;
}
*/

Also, &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; I remove string &lt;span class=&quot;code-quote&quot;&gt;&quot;WorkaroundToBeSaved&quot;&lt;/span&gt; from $a, it won&apos;t be saved with flush, although it is not empty (has $b field set).
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13971" author="jwage" created="Tue, 17 Aug 2010 02:35:33 +0000"  >&lt;p&gt;This is expected as well since we never store null values or empty arrays.&lt;/p&gt;</comment>
                    <comment id="13980" author="jwage" created="Tue, 17 Aug 2010 15:48:40 +0000"  >&lt;p&gt;After a second look we can fix this.&lt;/p&gt;</comment>
                    <comment id="13982" author="jwage" created="Tue, 17 Aug 2010 15:49:32 +0000"  >&lt;p&gt;Fixed by &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/b3a16496c0576e8f926faec9bbcfd5716006273b&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/b3a16496c0576e8f926faec9bbcfd5716006273b&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-46] @AlsoLoad annotation causes exception when used together with Embed/Reference annotations</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-46</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Imagine that there is following object in DB:&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;4c6936bf0f9d50300d000000&quot;&lt;/span&gt;,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;c&quot;&lt;/span&gt;: {
    &lt;span class=&quot;code-quote&quot;&gt;&quot;tmp&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;tmp&quot;&lt;/span&gt;
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And I want to rename property &quot;c&quot; to &quot;b&quot; in my class, using @AlsoLoad together with @EmbedOne&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;

    /**
     * @EmbedOne(targetDocument=&lt;span class=&quot;code-quote&quot;&gt;&quot;b&quot;&lt;/span&gt;)
     * @AlsoLoad(&lt;span class=&quot;code-quote&quot;&gt;&quot;c&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $b;
}

/** @EmbeddedDocument */
class b
{
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $tmp = &apos;tmp&apos;;
}

$a = $dm-&amp;gt;loadByID(&apos;a&apos;, &apos;4c6936bf0f9d50300d000000&apos;); &lt;span class=&quot;code-comment&quot;&gt;// will &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; an exception: Property &lt;span class=&quot;code-quote&quot;&gt;&quot;b&quot;&lt;/span&gt; in &lt;span class=&quot;code-quote&quot;&gt;&quot;a&quot;&lt;/span&gt; was already declared, but it must be declared only once&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
</description>
                <environment></environment>
            <key id="11776">MODM-46</key>
            <summary>@AlsoLoad annotation causes exception when used together with Embed/Reference annotations</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>Mon, 16 Aug 2010 09:11:13 +0000</created>
                <updated>Tue, 17 Aug 2010 16:57:27 +0000</updated>
                    <resolved>Tue, 17 Aug 2010 16:57:27 +0000</resolved>
                                            <fixVersion>1.0.0BETA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13986" author="jwage" created="Tue, 17 Aug 2010 16:57:27 +0000"  >&lt;p&gt;Fixed by &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/166ca49c13c8e3132b85383e4c55f0a09ce0d2b1&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/166ca49c13c8e3132b85383e4c55f0a09ce0d2b1&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-48] Embedded document changes are ignored if it was empty before</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-48</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Imaging the object in DB:&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;4c693f9f0f9d501c0d000000&quot;&lt;/span&gt;,
  &lt;span class=&quot;code-quote&quot;&gt;&quot;b&quot;&lt;/span&gt;: [
  ]
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then following code fails to update property &quot;b&quot;:&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;

    /** @EmbedOne(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 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 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;}
    function setB($b) {$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;b = $b;}
}

/** @EmbeddedDocument */
class b
{
    /** @&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 setVal($val) {$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;val = $val;}
    function getVal() {&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;}
}

$a = $dm-&amp;gt;loadByID(&apos;a&apos;, &apos;4c693f9f0f9d501c0d000000&apos;);
$a-&amp;gt;getB()-&amp;gt;setVal(&apos;test&apos;);

$dm-&amp;gt;persist($a);
$dm-&amp;gt;flush();
$dm-&amp;gt;getUnitOfWork()-&amp;gt;clear();

$a = $dm-&amp;gt;loadByID(&apos;a&apos;, $a-&amp;gt;getId());
$c = (&apos;test&apos; === $a-&amp;gt;getB()-&amp;gt;getVal());

var_dump($c); &lt;span class=&quot;code-comment&quot;&gt;// expecting &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;, but outputs &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11778">MODM-48</key>
            <summary>Embedded document changes are ignored if it was empty before</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>Mon, 16 Aug 2010 09:48:33 +0000</created>
                <updated>Tue, 17 Aug 2010 20:13:13 +0000</updated>
                    <resolved>Tue, 17 Aug 2010 20:13:13 +0000</resolved>
                                            <fixVersion>1.0.0BETA1</fixVersion>
                                <component>Persister</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13965" author="jwage" created="Mon, 16 Aug 2010 13:41:00 +0000"  >&lt;p&gt;Are you using the most recent version of mongo in git?&lt;/p&gt;</comment>
                    <comment id="13970" author="vladar" created="Mon, 16 Aug 2010 23:31:35 +0000"  >&lt;p&gt;Yes, just updated to today&apos;s version from git - got same results.&lt;/p&gt;</comment>
                    <comment id="13990" author="jwage" created="Tue, 17 Aug 2010 20:13:13 +0000"  >&lt;p&gt;Thanks for the issue!&lt;/p&gt;

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

<item>
            <title>[MODM-44] repositoryClass doesn&apos;t always get picked up for the Document Annotation</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-44</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Adding the following to getRepository after the $customRepositoryClassName=..&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;die(print_r( array($customRepositoryClassName, $metadata),&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Provides:&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 ( [0] =&amp;gt; [1] =&amp;gt; Doctrine\ODM\MongoDB\Mapping\ClassMetadata &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt; ( [db] =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt; [collection] =&amp;gt; User [identifier] =&amp;gt; id [file] =&amp;gt; [indexes] =&amp;gt; Array ( ) [name] =&amp;gt; Bundle\DoctrineUserBundle\Documents\User [namespace] =&amp;gt; Bundle\DoctrineUserBundle\Documents [rootDocumentName] =&amp;gt; Bundle\DoctrineUserBundle\Documents\User [customRepositoryClassName] =&amp;gt; [allowCustomID] =&amp;gt; [parentClasses] =&amp;gt; Array ( ) [subClasses] =&amp;gt; Array ( ) [reflFields] =&amp;gt; Array ( [id] =&amp;gt; ReflectionProperty &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt; ( [name] =&amp;gt; id [class] =&amp;gt; Bundle\DoctrineUserBundle\Documents\User ) ) [_prototype:Doctrine\ODM\MongoDB\Mapping\ClassMetadata:&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;] =&amp;gt; [inheritanceType] =&amp;gt; 1 [fieldMappings] =&amp;gt; Array ( [id] =&amp;gt; Array ( [id] =&amp;gt; 1 [fieldName] =&amp;gt; id [name] =&amp;gt; id [isCascadeRemove] =&amp;gt; [isCascadePersist] =&amp;gt; [isCascadeRefresh] =&amp;gt; [isCascadeMerge] =&amp;gt; [isCascadeDetach] =&amp;gt; [type] =&amp;gt; id [nullable] =&amp;gt; ) ) [lifecycleCallbacks] =&amp;gt; Array ( ) [discriminatorValue] =&amp;gt; [discriminatorMap] =&amp;gt; Array ( ) [discriminatorField] =&amp;gt; [reflClass] =&amp;gt; ReflectionClass &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt; ( [name] =&amp;gt; Bundle\DoctrineUserBundle\Documents\User ) [isMappedSuperclass] =&amp;gt; [isEmbeddedDocument] =&amp;gt; ) )
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For the following 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;/**
 * @Document(
 *   db=&lt;span class=&quot;code-quote&quot;&gt;&quot;account&quot;&lt;/span&gt;,
 *   collection=&lt;span class=&quot;code-quote&quot;&gt;&quot;sf_doctrine_user&quot;&lt;/span&gt;,
 *   indexes={
 *     @Index(keys={&lt;span class=&quot;code-quote&quot;&gt;&quot;username&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\UserBundle\Documents\UserRepository&quot;&lt;/span&gt;
 * )
 * @HasLifecycleCallbacks
 */
class User
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>SF2&lt;br/&gt;
Config for the Bundle:&lt;br/&gt;
doctrine_odm.mongodb:&lt;br/&gt;
&amp;nbsp;&amp;nbsp;server: &lt;a href=&quot;mongodb://localhost:27017&quot;&gt;mongodb://localhost:27017&lt;/a&gt;&lt;br/&gt;
&amp;nbsp;&amp;nbsp;options:&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;connect: true&lt;br/&gt;
&lt;br/&gt;
</environment>
            <key id="11750">MODM-44</key>
            <summary>repositoryClass doesn&apos;t always get picked up for the Document 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="5">Cannot Reproduce</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="dasher">D Ashwood</reporter>
                        <labels>
                    </labels>
                <created>Tue, 10 Aug 2010 19:38:23 +0000</created>
                <updated>Tue, 17 Aug 2010 16:48:25 +0000</updated>
                    <resolved>Tue, 17 Aug 2010 16:48:25 +0000</resolved>
                            <version>1.0.0BETA1</version>
                                                <component>Document Manager</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13897" author="dasher" created="Tue, 10 Aug 2010 20:08:53 +0000"  >&lt;p&gt;I suspect that it&apos;s due to the driver it&apos;s using - for some reason it wants to use the XMLDriver.&lt;/p&gt;</comment>
                    <comment id="13898" author="dasher" created="Tue, 10 Aug 2010 21:46:13 +0000"  >&lt;p&gt;Ok - I&apos;ve tracked down this issue and it&apos;s related to the XMLDriver being used as the default driver with SF2, MongoBundle &amp;amp; Mongo-odm.&lt;/p&gt;

&lt;p&gt;It&apos;ll try to annotation driver correctly if you have a folder called \Document.  It would be helpful if we could config the folder name.&lt;/p&gt;</comment>
                    <comment id="13899" author="jwage" created="Wed, 11 Aug 2010 00:00:47 +0000"  >&lt;p&gt;It works by detecting the files you have in your bundle. Do you have some .dcm.xml files in your bundle?&lt;/p&gt;</comment>
                    <comment id="13939" author="dasher" created="Thu, 12 Aug 2010 21:40:17 +0000"  >&lt;p&gt;Nope.  They&apos;re all PHP files.&lt;/p&gt;</comment>
                    <comment id="13985" author="jwage" created="Tue, 17 Aug 2010 16:48:25 +0000"  >&lt;p&gt;I can&apos;t reproduce anything here. It sounds like it would be a Symfony2 issue and not something with the ODM itself.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-42] PersistentCollection fails when working with MongoGridFs</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-42</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Getting following error when trying to use MongoGridFs files with referenceMany:&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;Argument 2 passed to Doctrine\ODM\MongoDB\UnitOfWork::getOrCreateDocument() must be an array, object given, called in 
D:\Work\www\syter2.localhost.dev\library\Doctrine\ODM\MongoDB\PersistentCollection.php on line 110 and defined
D:\Work\www\syter2.localhost.dev\library\Doctrine\ODM\MongoDB\UnitOfWork.php:1719
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As far as I understand queries against MongoGridFS collection return instances of MongoGridFSFile, while PersistentCollection only expects arrays (as with regular collections)&lt;/p&gt;

&lt;p&gt;I think Issue appeared after latest updates from git. Because I didn&apos;t experience it with ALPHA1 (didn&apos;t test with ALPHA2)&lt;/p&gt;</description>
                <environment></environment>
            <key id="11746">MODM-42</key>
            <summary>PersistentCollection fails when working with 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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vladar">Vladimir Razuvaev</reporter>
                        <labels>
                    </labels>
                <created>Tue, 10 Aug 2010 00:58:29 +0000</created>
                <updated>Tue, 17 Aug 2010 15:52:52 +0000</updated>
                    <resolved>Tue, 17 Aug 2010 15:52:52 +0000</resolved>
                                            <fixVersion>1.0.0BETA1</fixVersion>
                                <component>Collections</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13889" author="jwage" created="Tue, 10 Aug 2010 04:53:17 +0000"  >&lt;p&gt;I&apos;ll check it out, if you can provide a test that&apos;d be helpful.&lt;/p&gt;</comment>
                    <comment id="13892" author="vladar" created="Tue, 10 Aug 2010 09:09:13 +0000"  >&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;file&quot;&lt;/span&gt;) */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $files = array();

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

    function getFiles() {&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;files;}
}

/** @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;protected&lt;/span&gt; $file;

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

    function getMongoFile() {&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;file;}
}

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

$dm-&amp;gt;persist($f);
$dm-&amp;gt;persist($a);
$dm-&amp;gt;flush();

$dm-&amp;gt;getUnitOfWork()-&amp;gt;clear();

$a = $dm-&amp;gt;findOne(&apos;a&apos;, array());
foreach($a-&amp;gt;getFiles() as $file) {
    $file-&amp;gt;getMongoFile(); &lt;span class=&quot;code-comment&quot;&gt;// produces catchable fatal error
&lt;/span&gt;}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13895" author="jwage" created="Tue, 10 Aug 2010 15:22:13 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/964ce247841d11af8ab28cfbde36f6cc09b0d366&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/964ce247841d11af8ab28cfbde36f6cc09b0d366&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-43] Explicit schema migration</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-43</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Currently supported ways of schema migration are sufficient in many cases. But I think it&apos;s worth considering to have more explicit way to migrate schema for better readability / code maintenance.&lt;/p&gt;

&lt;p&gt;It might be useful to be able to transform original MongoDb data prior to hydration. Maybe as a new lifecycle callback (e.g. preLoad). This way one could have special property for schema version in the document and normalize data according to version differencies. e.g.:&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;function preLoad(array &amp;amp;$data)
{
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;(!isset($data[&apos;version&apos;])) {
        $data[&apos;version&apos;] = 1;
    }
    &lt;span class=&quot;code-keyword&quot;&gt;switch&lt;/span&gt;($data[&apos;version&apos;]) {
        &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; 1:
             $data[&apos;fullName&apos;] = $data[&apos;name&apos;];
             unset($data[&apos;name&apos;]);
             &lt;span class=&quot;code-comment&quot;&gt;// breaks are ommitted intentionally here and below
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; 2:
             $e = explode(&apos; &apos;, $data[&apos;fullName&apos;])
             $data[&apos;firstname&apos;] = $e[0];
             $data[&apos;lastname&apos;] = $e[1];
             unset($data[&apos;fullName&apos;]);
        &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; 3:
             $data[&apos;address&apos;] = array(
                 &apos;street&apos; =&amp;gt; $data[&apos;street&apos;],
                 &apos;city&apos; =&amp;gt; $data[&apos;city&apos;]
             );
             unset($data[&apos;street&apos;]);
             unset($data[&apos;city&apos;]);
         &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; 4:
         &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;:
              &lt;span class=&quot;code-comment&quot;&gt;// current version
&lt;/span&gt;    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Just as example. It also simplifies writing tests for schema migrations as I think. Is it possible with current ODM internals? What do you think? &lt;br/&gt;
I could try to implement this feature if it is acceptable proposal.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11748">MODM-43</key>
            <summary>Explicit schema migration</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="vladar">Vladimir Razuvaev</reporter>
                        <labels>
                    </labels>
                <created>Tue, 10 Aug 2010 09:55:45 +0000</created>
                <updated>Tue, 17 Aug 2010 16:46:39 +0000</updated>
                    <resolved>Tue, 17 Aug 2010 16:46:29 +0000</resolved>
                                            <fixVersion>1.0.0BETA1</fixVersion>
                                <component>Hydration</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13893" author="jwage" created="Tue, 10 Aug 2010 13:53:44 +0000"  >&lt;p&gt;I think this can be implemented already without having to change Doctrine. You just need to manage a version field and use the preLoad() like you are above. It is an acceptable idea, but I think it is already possible. What do you think?&lt;/p&gt;</comment>
                    <comment id="13901" author="vladar" created="Wed, 11 Aug 2010 01:22:22 +0000"  >&lt;p&gt;It&apos;s great if it is already possible. But I think there is no &quot;preLoad&quot;, &quot;preHydrate&quot; or similar event right now. At least I didn&apos;t find one in code or docs.&lt;/p&gt;</comment>
                    <comment id="13917" author="jwage" created="Wed, 11 Aug 2010 13:15:30 +0000"  >&lt;p&gt;Ok, I think maybe we can add a preLoad() event.&lt;/p&gt;</comment>
                    <comment id="13984" author="jwage" created="Tue, 17 Aug 2010 16:46:29 +0000"  >&lt;p&gt;Fixed by &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/78fefc3b70aa8ec0facd3cc4ffa27d6c88670407&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/78fefc3b70aa8ec0facd3cc4ffa27d6c88670407&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-40] Move value scalarization and comparison to Unit Of Work</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-40</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;The BasicDocumentPersister::_equals belongs in the UnitOfWork.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11733">MODM-40</key>
            <summary>Move value scalarization and comparison to Unit Of Work</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</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>Fri, 6 Aug 2010 14:59:24 +0000</created>
                <updated>Fri, 6 Aug 2010 22:11:17 +0000</updated>
                    <resolved>Fri, 6 Aug 2010 22:11:17 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                <version>1.0.0ALPHA2</version>
                                <fixVersion>1.0.0BETA1</fixVersion>
                                <component>Persister</component>
                <component>UnitOfWork</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13801" author="jwage" created="Fri, 6 Aug 2010 22:11:17 +0000"  >&lt;p&gt;I refactored and that code is not needed and gone now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-41] Hydration down not work for annotation &quot;@ReferenceMany&quot;</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-41</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;When you try to find or execute query, filds with annotation reference many (arrays) do not load.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;user.php&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;&amp;lt;?php

/**
 * @Document(db=&lt;span class=&quot;code-quote&quot;&gt;&quot;DB&quot;&lt;/span&gt;, 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;public&lt;/span&gt; $id;
    /**
     * @&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $name;
    /**
     * @&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $password;
    /**
     * @&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $email;
        /**
     * @ReferenceMany(targetDocument=&lt;span class=&quot;code-quote&quot;&gt;&quot;Group&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $groups = array();
}
?&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;group.php&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;&amp;lt;?php

/**
 * @Document(db=&lt;span class=&quot;code-quote&quot;&gt;&quot;MCI&quot;&lt;/span&gt;, collection=&lt;span class=&quot;code-quote&quot;&gt;&quot;Groups&quot;&lt;/span&gt;)
 */
class Group
{
    /**
     * @Id
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $id;
    /**
     * @&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $name;
    /**
     * @&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $role_name;

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

&lt;p&gt;When you execute this line:&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; $obj = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;findOne(&lt;span class=&quot;code-quote&quot;&gt;&quot;User&quot;&lt;/span&gt;,(&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt; =&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;Flavio&quot;&lt;/span&gt;));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;All the fields are returned correctly, but &quot;groups&quot; apear empty.&lt;/p&gt;

&lt;p&gt;When you use @EmbedMany annotation works file.&lt;/p&gt;

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

&lt;p&gt;PS: I&apos;m using codeigniter framework&lt;/p&gt;</description>
                <environment>Windows(webserver) / Unix (Mongo)</environment>
            <key id="11734">MODM-41</key>
            <summary>Hydration down not work for annotation &quot;@ReferenceMany&quot;</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="flaviolacer">Flavio Lacerda</reporter>
                        <labels>
                    </labels>
                <created>Fri, 6 Aug 2010 16:48:56 +0000</created>
                <updated>Mon, 9 Aug 2010 10:03:09 +0000</updated>
                    <resolved>Fri, 6 Aug 2010 23:39:57 +0000</resolved>
                            <version>1.0.0ALPHA2</version>
                                <fixVersion>1.0.0BETA1</fixVersion>
                                <component>Hydration</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13797" author="jwage" created="Fri, 6 Aug 2010 17:03:28 +0000"  >&lt;p&gt;This works for me. Can you provide a more exact test case that does not work?&lt;/p&gt;</comment>
                    <comment id="13803" author="flaviolacer" created="Fri, 6 Aug 2010 22:23:13 +0000"  >&lt;p&gt;I created an script.&lt;br/&gt;
Took a picture of output script too.&lt;/p&gt;</comment>
                    <comment id="13805" author="jwage" created="Fri, 6 Aug 2010 23:39:57 +0000"  >&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/cbe22dfd50225250ab468ea2f5e243736b2f35fd&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/cbe22dfd50225250ab468ea2f5e243736b2f35fd&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13876" author="flaviolacer" created="Mon, 9 Aug 2010 10:03:09 +0000"  >&lt;p&gt;Now works perfect. I&#180;m using it a lot. Amazing lib and amazing support.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10726" name="screenshot-script.jpg" size="214270" author="flaviolacer" created="Fri, 6 Aug 2010 22:25:43 +0000" />
                    <attachment id="10724" name="test.zip" size="406077" author="flaviolacer" created="Fri, 6 Aug 2010 22:23:54 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-38] Using YAML description with embedMany causes PHP notice error</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-38</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;When using the YAML style description together with the new embedMany functionality of mixed documents, you get a PHP notice error every time you create a new model.&lt;/p&gt;

&lt;p&gt;Because when you have mixed documents, you don&apos;t specify a targetDocument, and therefore the YAML Driver can not find an element in the array that describes the targetDocument.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11721">MODM-38</key>
            <summary>Using YAML description with embedMany causes PHP notice error</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>Wed, 4 Aug 2010 13:51:50 +0000</created>
                <updated>Fri, 6 Aug 2010 17:06:13 +0000</updated>
                    <resolved>Fri, 6 Aug 2010 17:06:13 +0000</resolved>
                            <version>1.0.0ALPHA2</version>
                                <fixVersion>1.0.0BETA1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13798" author="jwage" created="Fri, 6 Aug 2010 17:06:13 +0000"  >&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/8c8437a9113a0849f38db0664f66dd407a497918&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/8c8437a9113a0849f38db0664f66dd407a497918&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-35] Proxy item gets reset on persistent collection load if that item was in the collection</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-35</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description></description>
                <environment></environment>
            <key id="11706">MODM-35</key>
            <summary>Proxy item gets reset on persistent collection load if that item was in the 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="jwage">Jonathan H. Wage</assignee>
                                <reporter username="avalanche123">Bulat Shakirzyanov</reporter>
                        <labels>
                    </labels>
                <created>Mon, 2 Aug 2010 10:01:43 +0000</created>
                <updated>Fri, 6 Aug 2010 22:13:51 +0000</updated>
                    <resolved>Fri, 6 Aug 2010 22:13:41 +0000</resolved>
                            <version>1.0.0ALPHA2</version>
                                <fixVersion>1.0.0BETA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13802" author="jwage" created="Fri, 6 Aug 2010 22:13:41 +0000"  >&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/236d4c6fad228f281a6fff9979c5fdc3773969e1&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/236d4c6fad228f281a6fff9979c5fdc3773969e1&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-34] Custom Id always gets sent with changeset </title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-34</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Whenever the Unit of Work computes the changeset for a document with custom id, the id attribute always gets sent. &lt;/p&gt;</description>
                <environment></environment>
            <key id="11705">MODM-34</key>
            <summary>Custom Id always gets sent with changeset </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, 2 Aug 2010 09:24:47 +0000</created>
                <updated>Fri, 6 Aug 2010 23:15:38 +0000</updated>
                    <resolved>Fri, 6 Aug 2010 23:15:38 +0000</resolved>
                                            <fixVersion>1.0.0BETA1</fixVersion>
                                <component>UnitOfWork</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13804" author="jwage" created="Fri, 6 Aug 2010 23:15:38 +0000"  >&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/ad8a7821bd176e875b9ec1f756c32a15eed31fb3&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/ad8a7821bd176e875b9ec1f756c32a15eed31fb3&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-33] Class-level annotations are ignored if set on MappedSuperclass</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-33</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Class-level annotations: @HasLifecycleCallbacks, @InheritanceType, @DiscriminatorField, @DiscriminatorMap have no effect when defined on @MappedSuperclass&lt;/p&gt;

&lt;p&gt;You must explicitly set @HasLifecycleCallbacks for every document class to make callback work. As for inheritance annotations, you have to copy-paste all annotations to all document classes to make it work.&lt;/p&gt;

&lt;p&gt;Simple 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;/**
 * @MappedSuperclass
 * @HasLifecycleCallbacks
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class a
{
    /** @&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $a = &apos;&apos;;

    /** @PrePersist */
    function prePersist() {$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;a = &apos;a&apos;;}
}

/** @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 b &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; a
{}

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

&lt;p&gt;With this example prePersist won&apos;t be called. Not sure if it is bug or expected behavior, but it adds some inconvenience, especially with inheritance mapping.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11704">MODM-33</key>
            <summary>Class-level annotations are ignored if set on MappedSuperclass</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>Mon, 2 Aug 2010 02:28:49 +0000</created>
                <updated>Fri, 6 Aug 2010 23:51:42 +0000</updated>
                    <resolved>Fri, 6 Aug 2010 23:51:42 +0000</resolved>
                                            <fixVersion>1.0.0BETA1</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13759" author="jwage" created="Mon, 2 Aug 2010 16:10:51 +0000"  >&lt;p&gt;This appears to work for me. I tested it here &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/af9aa0f674f8b542c89f8c975ac403fd46f6e29e&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/af9aa0f674f8b542c89f8c975ac403fd46f6e29e&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13763" author="vladar" created="Mon, 2 Aug 2010 23:49:11 +0000"  >&lt;p&gt;Hi, looks like it affected ALPHA1. &lt;br/&gt;
I just updated to latest version from git and this issue disappeared. &lt;/p&gt;

&lt;p&gt;Also, want to thank you and other committers for ODM project. It is really cool!&lt;/p&gt;</comment>
                    <comment id="13780" author="vladar" created="Thu, 5 Aug 2010 01:08:52 +0000"  >&lt;p&gt;Looks like issue still exists for inheritance. At least following test case doesn&apos;t work for me on the latest version from git:&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
 * @InheritanceType(&lt;span class=&quot;code-quote&quot;&gt;&quot;SINGLE_COLLECTION&quot;&lt;/span&gt;)
 * @DiscriminatorField(fieldName=&lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;)
 * @DiscriminatorMap({
 *     &lt;span class=&quot;code-quote&quot;&gt;&quot;b&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;b&quot;&lt;/span&gt;,
 *     &lt;span class=&quot;code-quote&quot;&gt;&quot;c&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;c&quot;&lt;/span&gt;
 * })
 */
&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class a
{
    /** @&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; */
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $a = &apos;&apos;;
}

/** @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 b &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; a
{}

/** @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 c &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; a
{}

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

&lt;p&gt;New document will be created without &quot;type&quot; field. It works properly only if I copy-paste all annotations to every document class (b, c, etc).&lt;/p&gt;</comment>
                    <comment id="13787" author="jwage" created="Thu, 5 Aug 2010 11:32:27 +0000"  >&lt;p&gt;I don&apos;t think that is supposed to work. Try removing the @MappedSuperclass annotation.&lt;/p&gt;</comment>
                    <comment id="13790" author="vladar" created="Thu, 5 Aug 2010 23:46:24 +0000"  >&lt;p&gt;Removing @MappedSuperClass didn&apos;t help, but adding @Document annotation on abstract class did (it also allows to remove @Document annotation on concrete classes). &lt;/p&gt;

&lt;p&gt;The main point was to avoid annotations duplication, so I think this solution works pretty well. But maybe worth mentioning in the documentation, because it is pretty common use case to have one abstract class and several subclasses within same collection. And it took some time for me to find out how that could be done.&lt;/p&gt;</comment>
                    <comment id="13806" author="jwage" created="Fri, 6 Aug 2010 23:51:42 +0000"  >&lt;p&gt;Pretty sure it is fixed now.&lt;/p&gt;

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

<item>
            <title>[MODM-37] Problems with EmbedMany and discrimatorMap and discriminatorField</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-37</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;I&apos;m experiencing a problem when trying to embed documents and specify my own discriminatorMap and Field.&lt;/p&gt;

&lt;p&gt;This is the code I have:&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;ticket&quot;&lt;/span&gt;) */
    class App_Model_Ticket &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; App_Model_Abstract
    {
    	/**
    	 * @EmbedMany(
    	 *	discriminatorField = &lt;span class=&quot;code-quote&quot;&gt;&quot;type&quot;&lt;/span&gt;,
    	 *	discriminatorMap={
    	 *		&lt;span class=&quot;code-quote&quot;&gt;&quot;twitter&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;App_Model_Ticket_Twitter&quot;&lt;/span&gt;,
	 *		&lt;span class=&quot;code-quote&quot;&gt;&quot;email&quot;&lt;/span&gt;=&lt;span class=&quot;code-quote&quot;&gt;&quot;App_Model_Ticket_Email&quot;&lt;/span&gt;
	 *	})
	 */
    	&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $messages = array();
    
    	&lt;span class=&quot;code-comment&quot;&gt;// [...]
&lt;/span&gt;    }

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;App_Model_Abstract is a MappedSuperClass.&lt;/p&gt;

&lt;p&gt;App_Model_Ticket_Email and App_Model_Ticket_Twitter pretty much look alike right now:&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 App_Model_Ticket_Email &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; App_Model_Ticket_Message
    {
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and App_Model_Ticket_Message is another MappedSuperClass that extends App_Model_Abstract.&lt;/p&gt;

&lt;p&gt;Now, whenever I create a new model and persist it to mongoDB, the entry gets created and looks like 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;    [_id] =&amp;gt; MongoId &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt; (
    )
    [messages] =&amp;gt; Array (
        [0] =&amp;gt; Array (
            [message] =&amp;gt; Lorem ipsum
            [subject] =&amp;gt; Ich bin ein Berliner22
            [dateSent] =&amp;gt; MongoDate &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt; (
                [sec] =&amp;gt; 1280909855
                [usec] =&amp;gt; 0
            )
            [_doctrine_class_name] =&amp;gt; App_Model_Ticket_Twitter
        )
        [1] =&amp;gt; Array (
            [message] =&amp;gt; Lorem ipsum
            [subject] =&amp;gt; Ich bin ein Berliner22
            [dateSent] =&amp;gt; MongoDate &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt; (
                [sec] =&amp;gt; 1280909855
                [usec] =&amp;gt; 0
            )
            [_doctrine_class_name] =&amp;gt; App_Model_Ticket_Email
        )
    )
    [subject] =&amp;gt; Ich bin ein Berliner22
    [dateCreated] =&amp;gt; MongoDate &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt; (
        [sec] =&amp;gt; 1280909855
        [usec] =&amp;gt; 0
    )
    [dateLastMessage] =&amp;gt; MongoDate &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt; (
        [sec] =&amp;gt; 1280909855
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However, as you can see no type field for my embedded documents, it still uses _doctrine_class_name.&lt;/p&gt;

&lt;p&gt;But when I try to fetch this object, I get an exception saying &quot;Class not found&quot;.&lt;/p&gt;

&lt;p&gt;I think this is because right now Doctrine ODM does not write into the custom discriminatorField with embedded documents, but reads from it.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11720">MODM-37</key>
            <summary>Problems with EmbedMany and discrimatorMap and discriminatorField</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>Wed, 4 Aug 2010 13:51:19 +0000</created>
                <updated>Fri, 6 Aug 2010 17:09:14 +0000</updated>
                    <resolved>Fri, 6 Aug 2010 17:09:14 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                                <fixVersion>1.0.0BETA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13799" author="jwage" created="Fri, 6 Aug 2010 17:09:14 +0000"  >&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/618896bb8d879a8365dc359a8949c9d2cad5bec7&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/618896bb8d879a8365dc359a8949c9d2cad5bec7&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-32] dbref $id persisted as string instead of objectid</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-32</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;A clone of &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/issues/issue/2/&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/issues/issue/2/&lt;/a&gt;.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11702">MODM-32</key>
            <summary>dbref $id persisted as string instead of objectid</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>Sat, 31 Jul 2010 09:56:42 +0000</created>
                <updated>Fri, 6 Aug 2010 22:09:43 +0000</updated>
                    <resolved>Fri, 6 Aug 2010 22:09:43 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                <version>1.0.0ALPHA2</version>
                <version>1.0.0BETA1</version>
                                <fixVersion>1.0.0BETA1</fixVersion>
                                <component>Persister</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13800" author="jwage" created="Fri, 6 Aug 2010 22:09:43 +0000"  >&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/935759b498a057d08652379fb8133bb238b23a18&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/935759b498a057d08652379fb8133bb238b23a18&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-36] Embedded relations are not persisted after a flush()</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-36</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Newly added embedded relations do not get persisted when a flush() is executed before they are added to the parent document. Here is a failing test, note the comment &quot;// Adding this flush here makes level1 not to be inserted.&quot;:&lt;/p&gt;

&lt;p&gt;public function testFlushEmbedded()&lt;/p&gt;
  {
    $test = new EmbeddedTestLevel0();
    $test-&amp;gt;name = &apos;test&apos;;

    $this-&amp;gt;dm-&amp;gt;persist($test);
    $this-&amp;gt;dm-&amp;gt;flush();
    $this-&amp;gt;dm-&amp;gt;clear();

    $test = $this-&amp;gt;dm-&amp;gt;findOne(&apos;Documents\Functional\EmbeddedTestLevel0&apos;);
    $this-&amp;gt;assertInstanceOf(&apos;Documents\Functional\EmbeddedTestLevel0&apos;, $test);

    // Adding this flush here makes level1 not to be inserted.
    $this-&amp;gt;dm-&amp;gt;flush();
   
    $level1 = new EmbeddedTestLevel1();
    $level1-&amp;gt;name = &apos;test level1 #1&apos;;
    $test-&amp;gt;level1[] = $level1;

    $this-&amp;gt;dm-&amp;gt;persist($test);
    $this-&amp;gt;dm-&amp;gt;flush();
    $this-&amp;gt;dm-&amp;gt;clear();

    $test = $this-&amp;gt;dm-&amp;gt;findOne(&apos;Documents\Functional\EmbeddedTestLevel0&apos;);
    $this-&amp;gt;assertInstanceOf(&apos;Documents\Functional\EmbeddedTestLevel0&apos;, $test);
    $this-&amp;gt;assertInstanceOf(&apos;Documents\Functional\EmbeddedTestLevel1&apos;, $test-&amp;gt;level1[0]);

  } </description>
                <environment></environment>
            <key id="11711">MODM-36</key>
            <summary>Embedded relations are not persisted after a 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="pgodel">Pablo Godel</reporter>
                        <labels>
                    </labels>
                <created>Tue, 3 Aug 2010 21:44:55 +0000</created>
                <updated>Fri, 6 Aug 2010 17:01:41 +0000</updated>
                    <resolved>Fri, 6 Aug 2010 17:01:41 +0000</resolved>
                                            <fixVersion>1.0.0BETA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13791" author="vladar" created="Fri, 6 Aug 2010 02:56:54 +0000"  >&lt;p&gt;I also experience this issue. Formatted text from original message for convenience:&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;public&lt;/span&gt; function testFlushEmbedded() 
{
	$test = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; EmbeddedTestLevel0(); 
	$test-&amp;gt;name = &apos;test&apos;; 
	$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;persist($test); 
	$&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;clear(); 
	$test = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;findOne(&apos;Documents\Functional\EmbeddedTestLevel0&apos;);
	$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertInstanceOf(&apos;Documents\Functional\EmbeddedTestLevel0&apos;, $test); 
	&lt;span class=&quot;code-comment&quot;&gt;// Adding &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; flush here makes level1 not to be inserted. 
&lt;/span&gt;	$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;flush(); 

	$level1 = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; EmbeddedTestLevel1(); 
	$level1-&amp;gt;name = &apos;test level1 #1&apos;; 
	$test-&amp;gt;level1[] = $level1; 
	$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;persist($test); 
	$&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;clear(); 
	$test = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;dm-&amp;gt;findOne(&apos;Documents\Functional\EmbeddedTestLevel0&apos;); 
	$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertInstanceOf(&apos;Documents\Functional\EmbeddedTestLevel0&apos;, $test); 
	$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;assertInstanceOf(&apos;Documents\Functional\EmbeddedTestLevel1&apos;, $test-&amp;gt;level1[0]); 
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13793" author="jwage" created="Fri, 6 Aug 2010 07:57:12 +0000"  >&lt;p&gt;Do you all have the cascade operating enabled in your mapping?&lt;/p&gt;</comment>
                    <comment id="13796" author="jwage" created="Fri, 6 Aug 2010 17:01:41 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;http://github.com/doctrine/mongodb-odm/commit/20033a35a9cbf345636defdaaaa57204bae8fbab&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/commit/20033a35a9cbf345636defdaaaa57204bae8fbab&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10715" name="odm_functionalTest_testFlushEmbedded.php" size="869" author="pgodel" created="Tue, 3 Aug 2010 21:46:17 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-28] xml mapping : embedded-document  node is ignored, can&apos;t persist </title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-28</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;pre class=&quot;code-java&quot;&gt; 
&lt;span class=&quot;code-comment&quot;&gt;//file Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php line 171
&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; function _loadMappingFile($file)
    {
        $result = array();
        $xmlElement = simplexml_load_file($file);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($xmlElement-&amp;gt;document)) {
            foreach ($xmlElement-&amp;gt;document as $documentElement) {
                $documentName = (string) $documentElement[&apos;name&apos;];
                $result[$documentName] = $documentElement;
            }
        }
        
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $result;
    }

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

&lt;p&gt;embedded-document  and mapped-superclass are ignored so embed documents are not persisted&lt;/p&gt;

</description>
                <environment></environment>
            <key id="11681">MODM-28</key>
            <summary>xml mapping : embedded-document  node is ignored, can&apos;t persist </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>Mon, 26 Jul 2010 13:04:22 +0000</created>
                <updated>Tue, 27 Jul 2010 10:55:23 +0000</updated>
                    <resolved>Tue, 27 Jul 2010 10:55:23 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                                <fixVersion>1.0.0ALPHA2</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-30] yaml lifecycleCallbacks param expects an array not string</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-30</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;In the manual, when configuring lifecycleCallbacks&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;  lifecycleCallbacks:
    doStuffOnPrePersist: prePersist
    doStuffOnPostPersist: postPersist
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;it seems, that event name must be the key not the value&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;  lifecycleCallbacks:
    prePersist: doStuffOnPrePersist
    postPersist: doStuffOnPostPersist
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and when parsing it is expecting an array not a string&lt;/p&gt;

&lt;p&gt;maybe a fix would be :&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;// Doctrine/ODM/MongoDB/Mapping/Driver/YamlDriver.php  line 123
&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($element[&apos;lifecycleCallbacks&apos;])) {
            foreach ($element[&apos;lifecycleCallbacks&apos;] as $type =&amp;gt; $methods) {
&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;(!is_array($methods)){
$methods = array($methods);
}
                foreach ($methods as $method) {
                    $class-&amp;gt;addLifecycleCallback($method, constant(&apos;Doctrine\ODM\MongoDB\ODMEvents::&apos; . $type));
                }
            }
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11683">MODM-30</key>
            <summary>yaml lifecycleCallbacks param expects an array not string</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>Tue, 27 Jul 2010 06:18:23 +0000</created>
                <updated>Tue, 27 Jul 2010 10:23:51 +0000</updated>
                    <resolved>Tue, 27 Jul 2010 10:13:09 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13708" author="jwage" created="Tue, 27 Jul 2010 10:05:52 +0000"  >&lt;p&gt;Hi, where in the documentation do you see that example?&lt;/p&gt;</comment>
                    <comment id="13709" author="jwage" created="Tue, 27 Jul 2010 10:13:09 +0000"  >&lt;p&gt;I fixed the issue in the code but I can&apos;t locate the example documentation you are pasting to fix.&lt;/p&gt;</comment>
                    <comment id="13710" author="jwage" created="Tue, 27 Jul 2010 10:18:17 +0000"  >&lt;p&gt;Actually, I changed my mind. It will always require an array and we&apos;ll fix any wrong documentation. So this would be correct:&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;lifecycleCallbacks:
    prePersist: [doStuffOnPrePersist]
    postPersist: [doStuffOnPostPersist]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13711" author="jenreve" created="Tue, 27 Jul 2010 10:23:51 +0000"  >&lt;p&gt;Hi, &lt;br/&gt;
weird, i searched in tests units too, but i cant find it anymore...&lt;br/&gt;
sorry, i certainly did a mistake&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-27] It would be great to have a way to use different collection classes with referencing/embedding</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-27</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Currently ODM creates an instance of ArrayCollection for every referenced/embedded collection. &lt;/p&gt;

&lt;p&gt;It would be great, if there was a way to specify which collection class should be actually used. Imagine simple use-case: one have created class TagsCollection extends ArrayCollection with __toString method, which automatically transforms collection of tags to comma-separated tags string.&lt;/p&gt;

&lt;p&gt;Would it be possible to have e.g. @EmbedMany(collection=&quot;TagsCollection&quot;) ?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11673">MODM-27</key>
            <summary>It would be great to have a way to use different collection classes with referencing/embedding</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="2">Won&apos;t Fix</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vladar">Vladimir Razuvaev</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Jul 2010 10:46:47 +0000</created>
                <updated>Thu, 22 Jul 2010 23:17:59 +0000</updated>
                    <resolved>Thu, 22 Jul 2010 12:07:20 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                                                <component>Hydration</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13659" author="jwage" created="Thu, 22 Jul 2010 12:05:49 +0000"  >&lt;p&gt;Is it not just as simple for you to do this yourself instead of cluttering the Doctrine codebase? Simply wrap your collection with your own class. Use another class to do what you want, passing the collection to it.&lt;/p&gt;</comment>
                    <comment id="13660" author="jwage" created="Thu, 22 Jul 2010 12:07:12 +0000"  >&lt;p&gt;Also, doing this I think would not be a good idea as it&apos;s not really related to object domain persistence. I think you should do this in your own project by wrapping collections or having a convenience/helper method you can pass a collection of tags to, to get the comma separated tags string. I also think this is not a part of your domain model, it is more a part of your view layer.&lt;/p&gt;</comment>
                    <comment id="13669" author="vladar" created="Thu, 22 Jul 2010 23:17:59 +0000"  >&lt;p&gt;Well, that was just a simple example, I am pretty sure there might be other use-cases (related to domain model). Anyway if that is not an easy change, I&apos;ll use ArrayCollection here. Thanks for clarifications.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-26] MongoCursor doesn&apos;t implement Countable interface</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-26</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;this causes confusion when query returns empty array instead of MongoCursor object, meaning you can&apos;t use neither count($result) nor $result-&amp;gt;count(), and have to check for the returned type explicitly&lt;/p&gt;</description>
                <environment></environment>
            <key id="11621">MODM-26</key>
            <summary>MongoCursor doesn&apos;t implement Countable interface</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="avalanche123">Bulat Shakirzyanov</reporter>
                        <labels>
                    </labels>
                <created>Tue, 13 Jul 2010 10:40:39 +0000</created>
                <updated>Mon, 19 Jul 2010 13:09:48 +0000</updated>
                    <resolved>Mon, 19 Jul 2010 13:09:19 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                                <fixVersion>1.0.0ALPHA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13610" author="jwage" created="Mon, 19 Jul 2010 13:09:48 +0000"  >&lt;p&gt;Fixed and added a MongoCursorTest file.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-25] AnnotationDriver.php Line 175</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-25</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;$mapping&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;fieldName&amp;#39;&amp;#93;&lt;/span&gt; should be replace with something else.&lt;br/&gt;
Maybe create a whole new metadata property, or map load methods as onLoad lyfecycle events...&lt;/p&gt;</description>
                <environment></environment>
            <key id="11595">MODM-25</key>
            <summary>AnnotationDriver.php Line 175</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="avalanche123">Bulat Shakirzyanov</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Jul 2010 17:25:12 +0000</created>
                <updated>Mon, 19 Jul 2010 14:28:20 +0000</updated>
                    <resolved>Mon, 19 Jul 2010 14:28:20 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                                <fixVersion>1.0.0ALPHA2</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-22] Document incorrectly scheduled for update</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-22</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;I have the following documents:&lt;/p&gt;

&lt;p&gt;Product:&lt;br/&gt;
  product_id&lt;br/&gt;
  sellable (dbref)&lt;/p&gt;

&lt;p&gt;Sellable:&lt;br/&gt;
  product (dbref)&lt;br/&gt;
  seller (dbref)&lt;/p&gt;

&lt;p&gt;Seller:&lt;br/&gt;
  name&lt;/p&gt;

&lt;p&gt;If I create a new Sellable for a seller the seller gets scheduled for update even if nothing has changed.The document persister correctly doesn&apos;t try to actually execute the update but Lifecycle events still get called. The flow is:&lt;/p&gt;

&lt;p&gt;1. Schedule for update&lt;br/&gt;
2. Call _executeUpdate&lt;br/&gt;
3. Call preUpdate&lt;br/&gt;
4. Call BasicDocumentPersister::update(), which does nothing because of no actual changes&lt;br/&gt;
5. Call postUpdate.&lt;/p&gt;

&lt;p&gt;preUpdate and postUpdate being called when there&apos;s no actual changes is causing problems. It seems like the proper course of action would be to either not schedule the document for update or check if there&apos;s any actual changes before calling preUpdate and postUpdate.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11564">MODM-22</key>
            <summary>Document incorrectly scheduled for update</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="5">Cannot Reproduce</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ssurowiec">Steven Surowiec</reporter>
                        <labels>
                    </labels>
                <created>Mon, 28 Jun 2010 16:45:31 +0000</created>
                <updated>Mon, 19 Jul 2010 23:52:55 +0000</updated>
                    <resolved>Mon, 19 Jul 2010 23:52:55 +0000</resolved>
                                            <fixVersion>1.0.0ALPHA2</fixVersion>
                                <component>Document Manager</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13520" author="jwage" created="Mon, 5 Jul 2010 12:25:36 +0000"  >&lt;p&gt;I will take a look at this. Can you try creating a test case that reproduces the issue?&lt;/p&gt;</comment>
                    <comment id="13581" author="jwage" created="Tue, 13 Jul 2010 13:27:45 +0000"  >&lt;p&gt;Bulat, is this not fixed?&lt;/p&gt;</comment>
                    <comment id="13611" author="jwage" created="Mon, 19 Jul 2010 15:49:27 +0000"  >&lt;p&gt;Any chance of a test case? Could you provide the documents you are using?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-16] loadById failing on custom ids</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-16</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;DocumentManager::loadByID is failing on custom ids right now because it&apos;s checking for the custom id flag on the metadata and converting to \MongoID. It should probably be using the new $class-&amp;gt;getPHPIdentifierValue method instead.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11513">MODM-16</key>
            <summary>loadById failing on custom ids</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="ssurowiec">Steven Surowiec</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Jun 2010 08:40:29 +0000</created>
                <updated>Thu, 17 Jun 2010 09:11:33 +0000</updated>
                    <resolved>Thu, 17 Jun 2010 09:11:33 +0000</resolved>
                                            <fixVersion>1.0.0ALPHA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13355" author="ssurowiec" created="Thu, 17 Jun 2010 08:41:27 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;http://github.com/opensky/mongodb-odm/commit/78ac8bf8e31e91f88d2cdd7918db3ebaafe76a63&quot; class=&quot;external-link&quot;&gt;http://github.com/opensky/mongodb-odm/commit/78ac8bf8e31e91f88d2cdd7918db3ebaafe76a63&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13356" author="jwage" created="Thu, 17 Jun 2010 09:11:33 +0000"  >&lt;p&gt;Thanks for the issue and fix!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-17] Multiple array / object with same content/properties do not get persisted </title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-17</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;If I have a Collection field and try to add 2 values that are the same, the second value never gets saved to the document.  Example 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;class User
{
  /** @Id */
  &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;

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

  /** @Collection */
  &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $logs = array();

}
&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;    $o = $dm-&amp;gt;findOne(&apos;:User&apos;, array(&apos;name&apos; =&amp;gt; $arguments[&apos;name&apos;]));

    $found = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;

    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!$o) {
      $found = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
      $o = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
    }

    $o-&amp;gt;setName($arguments[&apos;name&apos;]);

    $o-&amp;gt;addLog( array(&apos;a&apos; =&amp;gt; &apos;b&apos; ));

    $dm-&amp;gt;persist($o);

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

&lt;p&gt;or a EmbeddedMany field, and try to add to add 2  objects with the same content the same thing happens:&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;class User
{
  /** @Id */
  &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $id;

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

  /** @EmbedMany(targetDocument=&lt;span class=&quot;code-quote&quot;&gt;&quot;UserLog&quot;&lt;/span&gt;) */
  &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $logs = array();
}
&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;    $o = $dm-&amp;gt;findOne(&apos;:User&apos;, array(&apos;name&apos; =&amp;gt; $arguments[&apos;name&apos;]));

    $found = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;

    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!$o) {
      $found = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;;
      $o = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
    }

    $o-&amp;gt;setName($arguments[&apos;name&apos;]);

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

    $l-&amp;gt;setMsg(&apos;Testing&apos;);

    $o-&amp;gt;addLog($l);

    $dm-&amp;gt;persist($o);

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

&lt;p&gt;If I change     $l-&amp;gt;setMsg(&apos;Testing&apos;.time());&lt;/p&gt;

&lt;p&gt;then it adds all the instances.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11516">MODM-17</key>
            <summary>Multiple array / object with same content/properties do not get 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="pgodel">Pablo Godel</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Jun 2010 10:55:10 +0000</created>
                <updated>Mon, 19 Jul 2010 17:13:16 +0000</updated>
                    <resolved>Mon, 19 Jul 2010 17:13:16 +0000</resolved>
                                            <fixVersion>1.0.0ALPHA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13612" author="jwage" created="Mon, 19 Jul 2010 16:11:25 +0000"  >&lt;p&gt;Seems to be working now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-15] addWhere</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-15</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;After removing addWhere &lt;a href=&quot;http://www.doctrine-project.org/projects/mongodb_odm/1.0/docs/reference/query-builder-api/en#addWhere&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/mongodb_odm/1.0/docs/reference/query-builder-api/en#addWhere&lt;/a&gt; should be updated.&lt;br/&gt;
$query = $dm-&amp;gt;createQuery(&apos;User&apos;)&lt;br/&gt;
    -&amp;gt;where(&apos;type&apos;, &apos;admin&apos;)&lt;br/&gt;
    -&amp;gt;where(&apos;active&apos;, 1);&lt;br/&gt;
like this, right?&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/mongodb-odm/blob/master/lib/Doctrine/ODM/MongoDB/Query.php#L313&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm/blob/master/lib/Doctrine/ODM/MongoDB/Query.php#L313&lt;/a&gt;&lt;br/&gt;
Is at least missleading.&lt;/p&gt;

&lt;p&gt;Thanks for the great work!&lt;/p&gt;</description>
                <environment></environment>
            <key id="11494">MODM-15</key>
            <summary>addWhere</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="fkubis">Florian Kubis</reporter>
                        <labels>
                    </labels>
                <created>Tue, 15 Jun 2010 02:59:20 +0000</created>
                <updated>Tue, 15 Jun 2010 12:09:20 +0000</updated>
                    <resolved>Tue, 15 Jun 2010 12:09:20 +0000</resolved>
                            <version>1.0.0ALPHA2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-12] Undefined variable error</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-12</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;In UnitOfWork::_computeAssociationChanges there are several references to $document but $document is never declared in that method, or passed into it. From looking at ORM it looks like $entry is the right variable to be using here.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11469">MODM-12</key>
            <summary>Undefined variable error</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="ssurowiec">Steven Surowiec</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Jun 2010 19:25:00 +0000</created>
                <updated>Wed, 9 Jun 2010 19:55:06 +0000</updated>
                    <resolved>Wed, 9 Jun 2010 19:46:06 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                                <fixVersion>1.0.0ALPHA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13261" author="ssurowiec" created="Wed, 9 Jun 2010 19:27:42 +0000"  >&lt;p&gt;Fixed in &lt;a href=&quot;http://github.com/opensky/mongodb-odm/tree/MODM-12&quot; class=&quot;external-link&quot;&gt;http://github.com/opensky/mongodb-odm/tree/MODM-12&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-13] Problems with merge()</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-13</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;while doing a merge, I got some PHP errors.&lt;br/&gt;
Seems like these steps fix the problem:&lt;br/&gt;
1. Change line 1215 of UnitOfWork.php to&lt;br/&gt;
$id = $class-&amp;gt;getIdentifierValue($document);&lt;br/&gt;
it was ValueS before&lt;/p&gt;

&lt;p&gt;2. in function _cascadeMerge starting in line 1464 of UnitOfWork.php&lt;br/&gt;
change the inner calls from:&lt;br/&gt;
                        $this-&amp;gt;_cascadeMerge($relatedDocument, $visited);&lt;br/&gt;
To:&lt;br/&gt;
                        $this-&amp;gt;_cascadeMerge($relatedDocument, $managedCopy, $visited);&lt;/p&gt;

&lt;p&gt;I didn&apos;t look deeper into ODM, just tried this to things and it seems to work now, so please excuse if it&apos;s bs ... &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/wink.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</description>
                <environment>OSX, HEAD</environment>
            <key id="11471">MODM-13</key>
            <summary>Problems with merge()</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="fkubis">Florian Kubis</reporter>
                        <labels>
                    </labels>
                <created>Thu, 10 Jun 2010 08:51:03 +0000</created>
                <updated>Thu, 10 Jun 2010 09:00:24 +0000</updated>
                    <resolved>Thu, 10 Jun 2010 08:59:11 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                                <fixVersion>1.0.0ALPHA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13267" author="jwage" created="Thu, 10 Jun 2010 09:00:24 +0000"  >&lt;p&gt;Thanks for reporting the issue!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-11] Allow custom persisters</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-11</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;I&apos;m trying to write a SoftDelete extension for Doctrine ODM but am unable to do so because I need to be able to either use my own, custom, Persister or my own, custom, MongoCollection proxy. Providing a custom persister seems like the way to go as it opens up the flexibility of creating other behaviors (such as a Paginator).&lt;/p&gt;</description>
                <environment></environment>
            <key id="11457">MODM-11</key>
            <summary>Allow custom persisters</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="2">Won&apos;t Fix</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ssurowiec">Steven Surowiec</reporter>
                        <labels>
                    </labels>
                <created>Mon, 7 Jun 2010 17:41:05 +0000</created>
                <updated>Wed, 9 Jun 2010 19:55:48 +0000</updated>
                    <resolved>Wed, 9 Jun 2010 19:55:48 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13132" author="ssurowiec" created="Mon, 7 Jun 2010 17:43:27 +0000"  >&lt;p&gt;Started in: &lt;a href=&quot;http://github.com/opensky/mongodb-odm/tree/topic-MODM-11&quot; class=&quot;external-link&quot;&gt;http://github.com/opensky/mongodb-odm/tree/topic-MODM-11&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13133" author="jwage" created="Mon, 7 Jun 2010 20:41:52 +0000"  >&lt;p&gt;I am not convinced this is a good idea. We need to think through this thoroughly before adding features like this.&lt;/p&gt;</comment>
                    <comment id="13228" author="jwage" created="Tue, 8 Jun 2010 17:21:28 +0000"  >&lt;p&gt;I think we need to allow custom ids that are not MongoId but I am not convinced allowing custom persisters is the right solution for you to create these extensions. We should see how this is best handled in the ORM and follow suit.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-10] Missing use statement in UnitOfWork</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-10</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;The UnitOfWork.php class has several references to LifecycleEventArgs but has no &apos;use&apos; statement for it. This causes syntax errors when trying to use lifecycle events.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11447">MODM-10</key>
            <summary>Missing use statement in UnitOfWork</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="ssurowiec">Steven Surowiec</reporter>
                        <labels>
                    </labels>
                <created>Sat, 5 Jun 2010 10:40:30 +0000</created>
                <updated>Wed, 9 Jun 2010 19:50:51 +0000</updated>
                    <resolved>Sun, 6 Jun 2010 14:38:55 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                                <fixVersion>1.0.0ALPHA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13109" author="ssurowiec" created="Sat, 5 Jun 2010 10:48:19 +0000"  >&lt;p&gt;Fixed in the below commit:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/opensky/mongodb-odm/commit/865527aa3403a1fd9f8acdddd0584e1b1e74438a&quot; class=&quot;external-link&quot;&gt;http://github.com/opensky/mongodb-odm/commit/865527aa3403a1fd9f8acdddd0584e1b1e74438a&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="13123" author="jwage" created="Sun, 6 Jun 2010 14:38:55 +0000"  >&lt;p&gt;Thanks for the issue and topic branch! Merged!&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-71] &quot;Getting Started&quot; Canonical example is needlessly confusing</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-71</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;&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;&lt;/p&gt;

&lt;p&gt;The &apos;/path/to/doctrine/&apos; placeholders are nondescript and confusing to new users, especially when the only way to make them work is to pass in just the path to the DocumentRoot.  That should be mentioned, cleaned up, re-purposed, re-clarified, reverted, or whichever adjective of adjustment is suitable.&lt;/p&gt;</description>
                <environment>Ubuntu 10.04&lt;br/&gt;
PHP 5.3.2</environment>
            <key id="11875">MODM-71</key>
            <summary>&quot;Getting Started&quot; Canonical example is needlessly confusing</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="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="cainiac">cainiac</reporter>
                        <labels>
                    </labels>
                <created>Thu, 2 Sep 2010 19:22:28 +0000</created>
                <updated>Fri, 3 Sep 2010 13:21:46 +0000</updated>
                    <resolved>Thu, 2 Sep 2010 20:23:04 +0000</resolved>
                            <version>1.0.0BETA1</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14259" author="jwage" created="Fri, 3 Sep 2010 12:07:27 +0000"  >&lt;p&gt;I don&apos;t understand, why did you open this then mark it as invalid? I agree the documentation needs some work, the code has been in heavy development and we try and make the documentation good, but it lacks and gets out of date sometimes.&lt;/p&gt;

&lt;p&gt;Anyways, I have to be honest your tone here just really irritated to me. Not just irritated, but made me angry. It comes off rude using words like &quot;hideous&quot;, &quot;God awful&quot; and other smart ass comments. Remember this is open source, if you don&apos;t like something, either make your suggestion in a non asshole way and move on or clone the documentation and fix it yourself!&lt;/p&gt;

&lt;p&gt;Thanks, Jon&lt;/p&gt;</comment>
                    <comment id="14262" author="jwage" created="Fri, 3 Sep 2010 13:11:32 +0000"  >&lt;p&gt;Does this change help? &lt;a href=&quot;http://github.com/doctrine/mongodb-odm-documentation/commit/a71440c84b013589277636db4992caf64c71c83e&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/mongodb-odm-documentation/commit/a71440c84b013589277636db4992caf64c71c83e&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&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;&lt;/p&gt;</comment>
                    <comment id="14263" author="cainiac" created="Fri, 3 Sep 2010 13:21:46 +0000"  >&lt;p&gt;You sexy man, had I encountered that yesterday, I would have been flying through the setup process!&lt;/p&gt;

&lt;p&gt;Sorry for the pissy tone in the beginning... my default literary stance is vitriolic polemics and I try my best (and fail) to keep it tucked away. :X&lt;/p&gt;

&lt;p&gt;The elaboration and the follow-up example at the end will certainly assist future users in gracefully integrating this great solution to their shops.&lt;/p&gt;

&lt;p&gt;Thanks, John!&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-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-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-167] Undefined index exception when a new document is detatched in onFlush</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-167</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Test and fix PR to come shortly&lt;/p&gt;</description>
                <environment></environment>
            <key id="13802">MODM-167</key>
            <summary>Undefined index exception when a new document is detatched in onFlush</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="superdweebie">Tim Roediger</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 Jun 2012 22:32:46 +0000</created>
                <updated>Wed, 27 Jun 2012 21:36:42 +0000</updated>
                    <resolved>Wed, 27 Jun 2012 21:36:42 +0000</resolved>
                                                            <component>UnitOfWork</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="18149" author="superdweebie" created="Wed, 27 Jun 2012 21:36:41 +0000"  >&lt;p&gt;Commit a260002 merged to resolve issue.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-3] API design</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-3</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;I know I am nit-picky, I&apos;m really just trying to help, but I think methods like save() that were recently added are just API bloat since all it does is persist + flush. The naming is also confusing, having both save and persist. If you really want to add a method to the public API to exchange 2 lines in user code against 1 line, then at least a more descriptive name would be better, like persistAndFlush().&lt;/p&gt;

&lt;p&gt;API design is difficult, don&apos;t take it too lightly (thats what php did, heh) &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;</description>
                <environment></environment>
            <key id="11299">MODM-3</key>
            <summary>API design</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="romanb">Roman S. Borschel</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Apr 2010 07:10:40 +0000</created>
                <updated>Wed, 9 Jun 2010 19:48:43 +0000</updated>
                    <resolved>Fri, 30 Apr 2010 12:29:43 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                                <fixVersion>1.0.0ALPHA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12789" author="romanb" created="Fri, 30 Apr 2010 07:24:46 +0000"  >&lt;p&gt;I think it just really helps ease of use if we keep the different APIs as similar as possible. Of course each can have their own methods, classes etc. We should just not overload the same names with completely different meanings in the different APIs.&lt;/p&gt;

&lt;p&gt;Concerning this example, it just doesnt look very streamlined if there are such minor extra methods like save/persistAndFlush that you don&apos;t have in the other APIs and are &lt;b&gt;neither&lt;/b&gt; mongo-specific (mongo-specific methods are fine!). Of course we don&apos;t want to fit the same API on all these projects, they should just not be too different in weird ways, like additional non-project-specific convenience methods that are available in one project but not in the other.&lt;/p&gt;

&lt;p&gt;I hope I explained that well. It&apos;s just about a polished API feeling when using the different Doctrine projects.&lt;/p&gt;</comment>
                    <comment id="12796" author="jwage" created="Fri, 30 Apr 2010 12:21:02 +0000"  >&lt;p&gt;I had the same thought when I was adding it and I wobbled back and fourth. Now that you say this I agree we should remove it.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-24] Hydratation of extra fields</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-24</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;I&apos;m working on a project using MongoDB with ODM especially for the schemaless features.&lt;br/&gt;
So I have one collection with some default fields in my base class.&lt;br/&gt;
Every inherited class add fields but we&apos;re still in the same collection.&lt;/p&gt;

&lt;p&gt;First, prior to save the document, I add the new mappings (imported from the inherited class) so they will be saved in the database. This part works fine.&lt;br/&gt;
The problem is that when the ODM hydrates the documents, it sticks to the $metadata-&amp;gt;fieldMappings defined by the base class, and ignore the others.&lt;/p&gt;

&lt;p&gt;I&apos;ve made a quick patch for that, but it doesn&apos;t make any type cast, I didn&apos;t inspect the code deep enough to make it better.&lt;/p&gt;

&lt;p&gt;In the Doctrine\ODM\MongoDB\Hydrator class (line 73) :&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;public&lt;/span&gt; function hydrate(ClassMetadata $metadata, $document, $data)
    {
        $values = array();

        &lt;span class=&quot;code-comment&quot;&gt;// Patch
&lt;/span&gt;        foreach ($data as $field =&amp;gt; $value)
        {
          &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;(!array_key_exists($field, $metadata-&amp;gt;fieldMappings))
          {
            $document-&amp;gt;$field = $value;
          }
        }
        &lt;span class=&quot;code-comment&quot;&gt;// end Patch
&lt;/span&gt;
        foreach ($metadata-&amp;gt;fieldMappings as $mapping) {
[...]

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11590">MODM-24</key>
            <summary>Hydratation of extra fields</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="oktodindon">Anonymous</reporter>
                        <labels>
                    </labels>
                <created>Tue, 6 Jul 2010 05:14:40 +0000</created>
                <updated>Mon, 19 Jul 2010 23:15:39 +0000</updated>
                    <resolved>Mon, 19 Jul 2010 23:15:39 +0000</resolved>
                                            <fixVersion>1.0.0ALPHA2</fixVersion>
                                <component>Hydration</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13613" author="jwage" created="Mon, 19 Jul 2010 23:15:21 +0000"  >&lt;p&gt;This is fixed now. Make sure your classes inheritance mapping is setup properly too if you have other problems.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-21] AnnotationDriver doesn&apos;t allow custom types</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-21</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Right now AnnotationDriver.php does not allow you to create custom types. You can with YAML and XML but the $types array on line ~142 of AnnotationDriver.php is hard coded so there&apos;s no way to get a custom type in there.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11562">MODM-21</key>
            <summary>AnnotationDriver doesn&apos;t allow custom types</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="ssurowiec">Steven Surowiec</reporter>
                        <labels>
                    </labels>
                <created>Mon, 28 Jun 2010 10:47:46 +0000</created>
                <updated>Mon, 19 Jul 2010 15:01:15 +0000</updated>
                    <resolved>Mon, 19 Jul 2010 15:01:15 +0000</resolved>
                                            <fixVersion>1.0.0ALPHA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-19] Field annotation missing &quot;name&quot; support</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-19</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;Documentation states that field names can be overriden by using a &quot;name&quot; parameter but Doctrine throws exception.&lt;br/&gt;
Also there is a missing comma in the documentation between the type and name params.&lt;/p&gt;

&lt;p&gt;From documentation:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.doctrine-project.org/projects/mongodb_odm/1.0/docs/reference/annotations-reference/en#ann_field&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/mongodb_odm/1.0/docs/reference/annotations-reference/en#ann_field&lt;/a&gt;&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;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;/**
 * @Field(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt; name=&lt;span class=&quot;code-quote&quot;&gt;&quot;origin&quot;&lt;/span&gt;)
 */
&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $country;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;My source 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;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;    /**
     * @Field(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;string&quot;&lt;/span&gt;, name=&lt;span class=&quot;code-quote&quot;&gt;&quot;password&quot;&lt;/span&gt;)
    **/
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $_password;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Exception:&lt;/p&gt;

&lt;p&gt;BadMethodCallException:&lt;br/&gt;
Unknown property &apos;name&apos; on annotation &apos;Doctrine\ODM\MongoDB\Mapping\Field&apos;.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11537">MODM-19</key>
            <summary>Field annotation missing &quot;name&quot; support</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="rabbit">Rabbit</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Jun 2010 16:06:17 +0000</created>
                <updated>Mon, 19 Jul 2010 15:51:10 +0000</updated>
                    <resolved>Mon, 19 Jul 2010 15:51:10 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                                <fixVersion>1.0.0ALPHA2</fixVersion>
                                <component>Mapping Drivers</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-14] Default database when @Document annotation does not contain a db attribute.</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-14</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;When a Document is annotated with @Document(collection=&quot;test&quot;) and is missing the db attribute the ODM defaults to mongo_dev. What i expected was it defaulted to the database name given when creating a connection.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11476">MODM-14</key>
            <summary>Default database when @Document annotation does not contain a db attribute.</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="7">Can&apos;t Fix</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="henrikbjorn">Henrik Bjornskov</reporter>
                        <labels>
                    </labels>
                <created>Fri, 11 Jun 2010 14:39:33 +0000</created>
                <updated>Fri, 11 Jun 2010 15:06:46 +0000</updated>
                    <resolved>Fri, 11 Jun 2010 15:06:46 +0000</resolved>
                                            <fixVersion>1.0.0ALPHA2</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13279" author="jwage" created="Fri, 11 Jun 2010 15:06:32 +0000"  >&lt;p&gt;We have no way to retrieve the database you connected to so you have to configure it by setting $config-&amp;gt;setDefaultDB(&apos;db_name&apos;);&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-9] Unexpected: MappedSuperclass private property without annotation becomes persisted</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-9</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;pre class=&quot;code-java&quot;&gt;/** @MappedSuperclass */
class Model {

    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $errors = array();

    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; function getErrors() {
        &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;errors;
    }
}

/**
 * @Document(db=&lt;span class=&quot;code-quote&quot;&gt;&quot;mydb&quot;&lt;/span&gt;, collection=&lt;span class=&quot;code-quote&quot;&gt;&quot;data&quot;&lt;/span&gt;)
 */
class Data &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Model {
    /**
     * @Id
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $id;

    /**
     * @&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;
     */
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $name;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Did not expect, that $errors goes into mongo.&lt;/p&gt;</description>
                <environment>OS X, latest ODM checkout</environment>
            <key id="11441">MODM-9</key>
            <summary>Unexpected: MappedSuperclass private property without annotation becomes persisted</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="fkubis">Florian Kubis</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Jun 2010 03:26:41 +0000</created>
                <updated>Wed, 9 Jun 2010 19:50:37 +0000</updated>
                    <resolved>Thu, 3 Jun 2010 18:59:10 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                                <fixVersion>1.0.0ALPHA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13098" author="jwage" created="Thu, 3 Jun 2010 18:59:10 +0000"  >&lt;p&gt;This is expected behavior. It was changed so that all properties are persisted unless specified otherwise. Map the property is @Transient and it will be ignored by 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;class MyDocument
{
    &lt;span class=&quot;code-comment&quot;&gt;// ...
&lt;/span&gt;
    /** @Transient */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $errors = array();
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="13104" author="fkubis" created="Fri, 4 Jun 2010 06:46:01 +0000"  >&lt;p&gt;Thanks, this works.&lt;br/&gt;
Just to complete this issue, for now documentation of @Transient is missing in the reference.&lt;br/&gt;
&lt;a href=&quot;http://www.doctrine-project.org/projects/mongodb_odm/1.0/docs/reference/annotations-reference/en&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/mongodb_odm/1.0/docs/reference/annotations-reference/en&lt;/a&gt; &lt;/p&gt;</comment>
                    <comment id="13105" author="jwage" created="Fri, 4 Jun 2010 11:40:09 +0000"  >&lt;p&gt;Thanks. I have updated the documentation with the new @Transient annotation.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-143] Mismatch in configuration classes, can&apos;t enable logging</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-143</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;My bootstrap:&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; 
        $config = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Doctrine\ODM\MongoDB\Configuration();
        $config-&amp;gt;setProxyDir(APPLICATION_PATH . &apos;/../data/cache&apos;);
        $config-&amp;gt;setProxyNamespace(&apos;Proxies&apos;);
        $config-&amp;gt;setDefaultDB([skip]);

        $config-&amp;gt;setHydratorDir(APPLICATION_PATH . &apos;/../data/cache&apos;);
        $config-&amp;gt;setHydratorNamespace(&apos;Hydrators&apos;);

        $config-&amp;gt;setLoggerCallable(function(array $log) { print_r($log); });

        $reader = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\Common\Annotations\AnnotationReader();
        $reader-&amp;gt;setDefaultAnnotationNamespace(&apos;Doctrine\ODM\MongoDB\Mapping\\&apos;);
        $config-&amp;gt;setMetadataDriverImpl(
            &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver($reader, __DIR__ . &apos;/Documents&apos;)
        );

        $manager = \Doctrine\ODM\MongoDB\DocumentManager::create(
            &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; \Doctrine\MongoDB\Connection(),
            $config
        );
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;And nothing happens &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;

&lt;p&gt;Trace from Doctrine\MongoDB\Configuration::getLoggerCallable():&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;#0 [skip]/Doctrine/MongoDB/Connection.php(248): Doctrine\MongoDB\Configuration-&amp;gt;getLoggerCallable()
#1 [skip]/Doctrine/MongoDB/Connection.php(231): Doctrine\MongoDB\Connection-&amp;gt;wrapDatabase(Object(MongoDB))
#2 [skip]/Doctrine/ODM/MongoDB/DocumentManager.php(287): Doctrine\MongoDB\Connection-&amp;gt;selectDatabase([skip])
#3 [skip]/Doctrine/ODM/MongoDB/DocumentManager.php(316): Doctrine\ODM\MongoDB\DocumentManager-&amp;gt;getDocumentDatabase(&apos;BPM\User&apos;)
#4 [skip]/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php(148): Doctrine\ODM\MongoDB\DocumentManager-&amp;gt;getDocumentCollection(&apos;BPM\User&apos;)
#5 [skip]/Doctrine/ODM/MongoDB/UnitOfWork.php(319): Doctrine\ODM\MongoDB\Persisters\DocumentPersister-&amp;gt;__construct(Object(Doctrine\ODM\MongoDB\Persisters\PersistenceBuilder), Object(Doctrine\ODM\MongoDB\DocumentManager), Object(Doctrine\Common\EventManager), Object(Doctrine\ODM\MongoDB\UnitOfWork), Object(Doctrine\ODM\MongoDB\Hydrator\HydratorFactory), Object(Doctrine\ODM\MongoDB\Mapping\ClassMetadata), &apos;$&apos;)
#6 [skip]/Doctrine/ODM/MongoDB/DocumentRepository.php(115): Doctrine\ODM\MongoDB\UnitOfWork-&amp;gt;getDocumentPersister(&apos;BPM\User&apos;)
#7 [skip]application/library/BPM/UserData.php(43): Doctrine\ODM\MongoDB\DocumentRepository-&amp;gt;find(&apos;4dc9d0192d91365...&apos;)
[skip]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;get_class($this) from Doctrine\MongoDB\Configuration::setLoggerCallable() write &apos;Doctrine\ODM\MongoDB\Configuration&apos; like expected, but in getLoggerCallable() write &apos;Doctrine\MongoDB\Configuration&apos;&lt;/p&gt;


&lt;p&gt;Do you have any ideas about this behaviour?&lt;/p&gt;</description>
                <environment></environment>
            <key id="12627">MODM-143</key>
            <summary>Mismatch in configuration classes, can&apos;t enable logging</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</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="korchasa">Stanislav Korchagin</reporter>
                        <labels>
                    </labels>
                <created>Wed, 11 May 2011 01:21:29 +0000</created>
                <updated>Mon, 16 May 2011 09:15:23 +0000</updated>
                    <resolved>Mon, 16 May 2011 09:15:23 +0000</resolved>
                            <version>1.0.0BETA3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15862" author="korchasa" created="Mon, 16 May 2011 09:15:23 +0000"  >&lt;p&gt;The error was in my bootstrap 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;- $manager = \Doctrine\ODM\MongoDB\DocumentManager::create(
-           new \Doctrine\MongoDB\Connection(),
-            $config
-        );
+ $manager = \Doctrine\ODM\MongoDB\DocumentManager::create(
+           null,
+            $config
+        );
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But confusion still exists, because I used an example from the documentation (&lt;a href=&quot;http://www.doctrine-project.org/docs/mongodb_odm/1.0/en/reference/introduction.html#setup&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/mongodb_odm/1.0/en/reference/introduction.html#setup&lt;/a&gt;).&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-6] Error In Documentation</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-6</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;@see &lt;a href=&quot;http://www.doctrine-project.org/projects/mongodb_odm/1.0/docs/cookbook/getting-started/en&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/mongodb_odm/1.0/docs/cookbook/getting-started/en&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Doctrine\Common\Annotations\AnnotationReader requires an instance Doctrine\Common\Cache\Cache to be passed to it on construction.  In the documentation above it is constructed with no such instance.&lt;/p&gt;

&lt;p&gt;Regards,&lt;/p&gt;

&lt;p&gt;Sam&lt;/p&gt;</description>
                <environment></environment>
            <key id="11370">MODM-6</key>
            <summary>Error In Documentation</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="6">Invalid</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="phuedx">Sam Smith</reporter>
                        <labels>
                    </labels>
                <created>Sun, 16 May 2010 04:38:15 +0000</created>
                <updated>Wed, 9 Jun 2010 19:49:49 +0000</updated>
                    <resolved>Thu, 20 May 2010 18:10:41 +0000</resolved>
                            <version>1.0.0ALPHA1</version>
                                <fixVersion>1.0.0ALPHA1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12980" author="avalanche123" created="Sun, 16 May 2010 13:08:11 +0000"  >&lt;p&gt;check this out - &lt;a href=&quot;http://github.com/jwage/doctrine2/blob/master/lib/Doctrine/Common/Annotations/AnnotationReader.php#L65&quot; class=&quot;external-link&quot;&gt;http://github.com/jwage/doctrine2/blob/master/lib/Doctrine/Common/Annotations/AnnotationReader.php#L65&lt;/a&gt;&lt;br/&gt;
as you can see, the $cache in the __construct, is defaulted to null, which makes it unnecessary to pass cache instance to the constructor, in which case \Doctrine\Common\Cache\ArrayCache will be used.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[MODM-39] Update project description on the projects page</title>
                <link>http://www.doctrine-project.org/jira/browse/MODM-39</link>
                <project id="10044" key="MODM">Doctrine MongoDB ODM</project>
                        <description>&lt;p&gt;The projects page &lt;a href=&quot;http://www.doctrine-project.org/projects&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects&lt;/a&gt; says that ODM MongoDB is for PHP 5.3.0, whereas it really is for PHP 5.3.2+, as far as I know.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11728">MODM-39</key>
            <summary>Update project description on the projects page</summary>
                <type id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/task.png">Task</type>
                                <priority id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/trivial.png">Trivial</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>Thu, 5 Aug 2010 17:08:24 +0000</created>
                <updated>Tue, 17 Aug 2010 15:52:27 +0000</updated>
                    <resolved>Tue, 17 Aug 2010 15:52:27 +0000</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>