<!--
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Thu Jun 20 01:52:46 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+DC+AND+resolution+%3D+Unresolved+AND+component+%3D+Record+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+DC+AND+resolution+%3D+Unresolved+AND+component+%3D+Record+ORDER+BY+priority+DESC</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="47" total="47"/>
                <build-info>
            <version>5.2.7</version>
            <build-number>850</build-number>
            <build-date>21-02-2013</build-date>
        </build-info>
<item>
            <title>[DC-952] Non-Equal Nest Relations Not Working - from &quot;Children&quot; side</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-952</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I&apos;ve copy &amp;amp; pasted example from &lt;a href=&quot;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/defining-models/1_0#relationships:join-table-associations:self-referencing-nest-relations:non-equal-nest-relations&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/projects/orm/1.2/docs/manual/defining-models/1_0#relationships:join-table-associations:self-referencing-nest-relations:non-equal-nest-relations&lt;/a&gt; .&lt;br/&gt;
I&apos;ve created User backend module using doctrine:generate-admin backend User task. On how to reproduce the error:&lt;/p&gt;

&lt;p&gt;1. Add 3 User objects (A,B,C)&lt;br/&gt;
2. Open generated edit form for User A.&lt;br/&gt;
3. Set User B as Children from Children list and Save&lt;br/&gt;
4. Set User B and C as Chidren from Children list and Save&lt;/p&gt;

&lt;p&gt;As a result you will see only C set as Children, and strange situation in database : &lt;/p&gt;

&lt;p&gt;UserReference Table:&lt;/p&gt;

&lt;p&gt;parent_id  |  child_id&lt;br/&gt;
    pk_B      |    pk_B       (!!!)&lt;br/&gt;
    pk_A      |    pk_C&lt;/p&gt;
</description>
                <environment>Ubuntu 10.04 + PHP 5.3.3 + Symfony 1.4.8</environment>
            <key id="12278">DC-952</key>
            <summary>Non-Equal Nest Relations Not Working - from &quot;Children&quot; side</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="pawelbaranski">Pawe&#322; Bara&#324;ski</reporter>
                        <labels>
                    </labels>
                <created>Mon, 3 Jan 2011 10:15:37 +0000</created>
                <updated>Thu, 24 Mar 2011 04:59:10 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Record</component>
                <component>Relations</component>
                        <due></due>
                    <votes>4</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="15111" author="pawelbaranski" created="Thu, 6 Jan 2011 09:41:02 +0000"  >&lt;p&gt;Same ticket on symfony trac because I&apos;m not sure whose fault is it &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;&lt;a href=&quot;http://trac.symfony-project.org/ticket/9398&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/ticket/9398&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also some new error path there&lt;/p&gt;</comment>
                    <comment id="15574" author="bigbadbassman" created="Thu, 24 Mar 2011 04:56:07 +0000"  >&lt;p&gt;Test Case of Non-Equal Self-Referencing Relations, based on #&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-329&quot; title=&quot;Problem saving Self Referencing (Nest Relations)&quot;&gt;DC-329&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Failure occures in line 75 of the test case file. This should not happen!&lt;br/&gt;
Only the parent object is modified in line 73 and saving should not interfere with the relations.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10958" name="DC952TestCase.php" size="4075" author="bigbadbassman" created="Thu, 24 Mar 2011 04:56:07 +0000" />
                </attachments>
            <subtasks>
            <subtask id="12323">DC-958</subtask>
        </subtasks>
        </item>

<item>
            <title>[DC-313] Ordering m2m relationship with column from related table (with orderBy option)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-313</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I find no way to define automatic orderBy in m2m relations with column not from reference table, but actual related table.&lt;/p&gt;

&lt;p&gt;E.g. BlogPost &amp;lt;= m2m through BlogPostCategory =&amp;gt; BlogCategory&lt;br/&gt;
I need BlogPost-&amp;gt;Categories ordered by BlogCategory.name&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 BlogPost &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;title&apos;, &apos;string&apos;, 128);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;content&apos;, &apos;string&apos;);
    }
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;BlogCategory as BlogCategories&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_blog_post&apos;, &apos;foreign&apos; =&amp;gt; &apos;id_blog_category&apos;, &apos;refClass&apos; =&amp;gt; &apos;BlogPostCategory&apos;, &apos;orderBy&apos; =&amp;gt; &apos;name&apos;));        
    }
}

class BlogCategory &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;name&apos;, &apos;string&apos;, 128);
    }
    
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;BlogPost as BlogPosts&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_blog_category&apos;, &apos;foreign&apos; =&amp;gt; &apos;id_blog_post&apos;, &apos;refClass&apos; =&amp;gt; &apos;BlogPostCategory&apos;));
    }
}

class BlogPostCategory &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id_blog_post&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(&apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id_blog_category&apos;, &apos;integer&apos;, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, array(&apos;primary&apos; =&amp;gt; &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 setUp()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;BlogPost&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_blog_post&apos;, &apos;foreign&apos; =&amp;gt; &apos;id&apos;, &apos;onDelete&apos; =&amp;gt; &apos;CASCADE&apos;));
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;BlogCategory&apos;, array(&apos;local&apos; =&amp;gt; &apos;id_blog_category&apos;, &apos;foreign&apos; =&amp;gt; &apos;id&apos;, &apos;onDelete&apos; =&amp;gt; &apos;CASCADE&apos;));
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The resulting query contains doubled &apos;name&apos; column in ORDER BY clause, both from reference table and related table, e.g. ORDER BY t2.name, t3.name&lt;/p&gt;

&lt;p&gt;I tried putting the following code in BlogCategory::setTableDefinition() instead of attribute in relation definition in BlogPost 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;$&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;option(&apos;orderBy&apos;, &apos;name&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;but the result was the same.&lt;/p&gt;

&lt;p&gt;Maybe I&apos;m doing something wrong? Is there a possibility to define an alias, where to get column name from - in orderBy attribute?&lt;/p&gt;

&lt;p&gt;Thanks in advance.&lt;/p&gt;</description>
                <environment>php 5.3/win, doctrine 1.2 svn, ATTR_QUOTE_IDENTIFIER = true, ATTR_USE_DQL_CALLBACKS = true</environment>
            <key id="10546">DC-313</key>
            <summary>Ordering m2m relationship with column from related table (with orderBy option)</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mh">Maciej Ho&#322;yszko</reporter>
                        <labels>
                    </labels>
                <created>Wed, 2 Dec 2009 12:53:05 +0000</created>
                <updated>Fri, 18 Feb 2011 03:32:42 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Record</component>
                <component>Relations</component>
                        <due></due>
                    <votes>3</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="10969" author="mh" created="Wed, 2 Dec 2009 12:53:49 +0000"  >&lt;p&gt;Attached test case.&lt;/p&gt;</comment>
                    <comment id="11080" author="mh" created="Tue, 8 Dec 2009 12:59:05 +0000"  >&lt;p&gt;I find this issue as critical one now, because when I use 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-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;option(&apos;orderBy&apos;, &apos;name&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;in a model&apos;s definition (not ref class), then when other model is related m2m with it, a query loading both of them with relations will fail because of name column duplicated in ref table.&lt;/p&gt;</comment>
                    <comment id="12740" author="suhock" created="Fri, 23 Apr 2010 05:18:13 +0000"  >&lt;p&gt;I am having the same issue with an equivalent test case. For some reason, the &lt;tt&gt;&apos;orderBy&apos;&lt;/tt&gt; option on the target of the join (set by calling the &lt;tt&gt;option()&lt;/tt&gt; function inside the &lt;tt&gt;setUp()&lt;/tt&gt; method of the model class, not the ref class) is being applied to the relation table. After digging through the 1.2.2 tag a bit, I found altering line 1319 of Query.php as follows seems to fix the problem (at least against my test cases):&lt;/p&gt;

&lt;p&gt;&lt;del&gt;&lt;tt&gt;if (isset($map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relation&amp;#39;&amp;#93;&lt;/span&gt;)) {&lt;/tt&gt;&lt;/del&gt;&lt;br/&gt;
&lt;ins&gt;&lt;tt&gt;if (isset($map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relation&amp;#39;&amp;#93;&lt;/span&gt;) &amp;amp;&amp;amp; $map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;relation&amp;#39;&amp;#93;&lt;/span&gt;-&amp;gt;getTable() === $map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;table&amp;#39;&amp;#93;&lt;/span&gt;) {&lt;/tt&gt;&lt;/ins&gt;&lt;/p&gt;

&lt;p&gt;I&apos;ll do some more thorough testing and submit a patch if I find time.&lt;/p&gt;</comment>
                    <comment id="15332" author="bwegrzyn" created="Thu, 17 Feb 2011 09:45:31 +0000"  >&lt;p&gt;I had this issue as well. suhock&apos;s solution fixed it for me. It would be nice if this was merged in to a bug fix release of Doctrine 1.x.&lt;/p&gt;</comment>
                    <comment id="15336" author="suhock" created="Fri, 18 Feb 2011 03:32:42 +0000"  >&lt;p&gt;I ended up creating a new ticket, &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-651&quot; class=&quot;external-link&quot;&gt;DC-651&lt;/a&gt;, which addresses a more general problem with the orderBy feature. You should use the attached Ticket_DC651.patch instead, as I found the solution I provided here is not completely correct and does not pass all test cases.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10202" name="DC313TestCase.php" size="3659" author="mh" created="Wed, 2 Dec 2009 12:53:49 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-770] Result Cache</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-770</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine result cache isn&apos;t working properly.&lt;/p&gt;

&lt;p&gt;Here a simple example, when I&apos;m calling query-&amp;gt;execute (); parentProgram is related to a video.&lt;br/&gt;
Into the Doctrine_Query_Abstract.php file&lt;/p&gt;

&lt;p&gt;line 1014 : I have just add some code to output data.&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;code&amp;#93;&lt;/span&gt;&lt;br/&gt;
            if ($cached === false) &lt;/p&gt;
{
                // cache miss
                $stmt = $this-&amp;gt;_execute($params);
                $this-&amp;gt;_hydrator-&amp;gt;setQueryComponents($this-&amp;gt;_queryComponents);
                $result = $this-&amp;gt;_hydrator-&amp;gt;hydrateResultSet($stmt, $this-&amp;gt;_tableAliasMap);
                $oVideo = $result[0];
                echo &quot;not cached &quot;;
                var_dump (count ($oVideo-&amp;gt;parentProgram-&amp;gt;getReferences ()));
                $cached = $this-&amp;gt;getCachedForm($result);
                $cacheDriver-&amp;gt;save($hash, $cached, $this-&amp;gt;getResultCacheLifeSpan());
            }
&lt;p&gt; else &lt;/p&gt;
{
                $result = $this-&amp;gt;_constructQueryFromCache($cached);
                $oVideo = $result[0];
                echo &quot;cached &quot;;
                var_dump (count ($oVideo-&amp;gt;parentProgram-&amp;gt;getReferences ()));
                exit (0);
                
            }
&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;/code&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;The output of a query execution (the first with an empty APC cache) with &quot;useResultCache&quot; is : &lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;not cached int(1)&lt;/li&gt;
	&lt;li&gt;cached int(0)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The problem is coming from the serialize php function that can&apos;t serialize protected properties..&lt;br/&gt;
getReferences is a getter to a protected property.. So data result can&apos;t work properly.&lt;/p&gt;

&lt;p&gt;A solution could be use __sleep function, and a public property that contain all important protected data.&lt;/p&gt;
</description>
                <environment></environment>
            <key id="11566">DC-770</key>
            <summary>Result Cache</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="armetiz">Thomas Tourlourat - Armetiz</reporter>
                        <labels>
                    </labels>
                <created>Tue, 29 Jun 2010 05:50:36 +0000</created>
                <updated>Tue, 29 Jun 2010 05:50:36 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-857] postHydrate not called for One to One relations, when ATTR_HYDRATE_OVERWRITE == false, and the record is cached in the table&apos;s identityMap</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-857</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When objects are hydrated with a join to a one to one relation, if the queried object is stored in the table&apos;s cache, and ATTR_HYDRATE_OVERWRITE set to false, then the one to one relation&apos;s postHydrate method will never be called.&lt;/p&gt;

&lt;p&gt;This is due to &lt;a href=&quot;http://github.com/doctrine/doctrine1/blob/master/lib/Doctrine/Hydrator/Graph.php#L255&quot; class=&quot;external-link&quot;&gt;this line&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;pre class=&quot;code-java&quot;&gt; 
} &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ( ! isset($prev[$parent][$relationAlias])) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;...which will always evaluate to false, and postHydrate will ever be called, as the record has been pulled from the table cache &lt;a href=&quot;http://github.com/doctrine/doctrine1/blob/master/lib/Doctrine/Hydrator/Graph.php#L155&quot; class=&quot;external-link&quot;&gt;here&lt;/a&gt;&lt;/p&gt;</description>
                <environment>All</environment>
            <key id="11878">DC-857</key>
            <summary>postHydrate not called for One to One relations, when ATTR_HYDRATE_OVERWRITE == false, and the record is cached in the table&apos;s identityMap</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ben.davies">Ben Davies</reporter>
                        <labels>
                    </labels>
                <created>Fri, 3 Sep 2010 09:25:22 +0000</created>
                <updated>Sun, 5 Sep 2010 12:41:13 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14253" author="ben.davies" created="Fri, 3 Sep 2010 09:27:24 +0000"  >&lt;p&gt;Test case attached.&lt;/p&gt;</comment>
                    <comment id="14254" author="ben.davies" created="Fri, 3 Sep 2010 09:30:09 +0000"  >&lt;p&gt;There needs to be some kind of caching on the pre/postHydrate calls, which is done throughout the Doctrine_Hydrator_Graph, except for when the relation is one-to-one.&lt;br/&gt;
This is done &lt;a href=&quot;http://github.com/doctrine/doctrine1/blob/master/lib/Doctrine/Hydrator/Graph.php#L224&quot; class=&quot;external-link&quot;&gt;just above&lt;/a&gt;, for relations that are not one-to-one.&lt;/p&gt;

&lt;p&gt;Unfortunately, I couldn&apos;t work out how to implement it for one-to-one.&lt;br/&gt;
Probably a simple fix for someone familiar with the code&lt;/p&gt;</comment>
                    <comment id="14255" author="ben.davies" created="Fri, 3 Sep 2010 11:31:45 +0000"  >&lt;p&gt;Correct Test Case&lt;/p&gt;</comment>
                    <comment id="14257" author="ben.davies" created="Fri, 3 Sep 2010 11:37:03 +0000"  >&lt;p&gt;Correct Test Case&lt;/p&gt;</comment>
                    <comment id="14279" author="ben.davies" created="Sun, 5 Sep 2010 12:41:13 +0000"  >&lt;p&gt;I was probably a little too tired to think this through clearly on a Friday after a long weeks work!&lt;br/&gt;
Patched attached, which doesn&apos;t break any of the existing unit tests.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10774" name="DC857.patch" size="1051" author="ben.davies" created="Sun, 5 Sep 2010 12:41:13 +0000" />
                    <attachment id="10773" name="DC857TestCase.php" size="2194" author="ben.davies" created="Fri, 3 Sep 2010 11:37:36 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-371] Lazy loading - doctrine makes extra queries into db</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-371</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Just downloaded symfony 1.4&lt;/p&gt;

&lt;p&gt;First of all I have a query:&lt;/p&gt;

&lt;p&gt;                $q = \Doctrine_Query::create()&lt;br/&gt;
                    -&amp;gt;select(&apos;u.&lt;b&gt;, ur.&lt;/b&gt;&apos;)&lt;br/&gt;
                    -&amp;gt;from(&apos;UserDb u&apos;)&lt;br/&gt;
                    -&amp;gt;leftJoin(&apos;u.RealUserDetailsDb ur&apos;)&lt;br/&gt;
                    -&amp;gt;leftJoin(&apos;u.MockUserDetailsDb um&apos;)&lt;br/&gt;
                    -&amp;gt;where(&apos;u.id = :user_id&apos;)&lt;br/&gt;
                ;&lt;br/&gt;
                $user = $q-&amp;gt;fetchOne(array(&apos;:user_id&apos; =&amp;gt; $uid));&lt;/p&gt;

&lt;p&gt;After that I&apos;m accessing the fields of this object:&lt;/p&gt;

&lt;p&gt;                $userArray = array(&lt;br/&gt;
                    &apos;id&apos; =&amp;gt; $this-&amp;gt;getUser()-&amp;gt;getId(),&lt;br/&gt;
                    &apos;real_user_details_id&apos; =&amp;gt; $this-&amp;gt;getUser()-&amp;gt;getRealUserDetailsId(),&lt;br/&gt;
                    &apos;mock_user_details_id&apos; =&amp;gt; $this-&amp;gt;getUser()-&amp;gt;getMockUserDetailsId(),&lt;br/&gt;
                    &apos;real_user_details&apos; =&amp;gt; array(),&lt;br/&gt;
                    &apos;mock_user_details&apos; =&amp;gt; array()&lt;br/&gt;
                );&lt;/p&gt;

&lt;p&gt;This is the actual queries into DB:&lt;/p&gt;

&lt;p&gt;NR1:&lt;br/&gt;
SELECT u.id AS u_&lt;em&gt;id, u.user_real_id AS u&lt;/em&gt;&lt;em&gt;user_real_id, u.user_mock_id AS u&lt;/em&gt;&lt;em&gt;user_mock_id, u2.id AS u2&lt;/em&gt;&lt;em&gt;id, u2.nickname AS u2&lt;/em&gt;&lt;em&gt;nickname, u2.email AS u2&lt;/em&gt;_email FROM user u LEFT JOIN user_real u2 ON u.user_real_id = u2.id LEFT JOIN user_mock u3 ON u.user_mock_id = u3.id WHERE (u.id = :user_id)&lt;/p&gt;

&lt;p&gt;NR2:&lt;br/&gt;
SELECT u.id AS u_&lt;em&gt;id, u.user_real_id AS u&lt;/em&gt;&lt;em&gt;user_real_id, u.user_mock_id AS u&lt;/em&gt;_user_mock_id FROM user u WHERE (u.id = &apos;1&apos;) LIMIT 1&lt;/p&gt;

&lt;p&gt;As you can see there are TWO queries however there should be only one query. The problem is that u.user_real_id is NULL in database and when I do  &apos;real_user_details_id&apos; =&amp;gt; $this-&amp;gt;getUser()-&amp;gt;getRealUserDetailsId() doctrine does not have enough intelligence to understand that these fields have been already requested in NR1. If I comment this field, everything works well. &lt;/p&gt;

&lt;p&gt;SURPRISE! &lt;br/&gt;
And now a surprise... if I modify a little bit my first query: &quot;&lt;del&gt;&amp;gt;select(&apos;u.&lt;b&gt;&apos;)&quot; instead of , &quot;&lt;/del&gt;&amp;gt;select(&apos;u.&lt;/b&gt;,  ur.*&apos;)&quot; it WON&apos;T make TWO queries. It will make ONLY ONE!&lt;/p&gt;

&lt;p&gt;As you understand this a very critical bug and of course our system won&apos;t go to production with this bug. &lt;/p&gt;

&lt;p&gt;P.S. Is it possible to turn off the lazy loading in doctrine?&lt;/p&gt;</description>
                <environment>Symfony 1.4, Doctrine Version: 1.2.0-BETA3</environment>
            <key id="10636">DC-371</key>
            <summary>Lazy loading - doctrine makes extra queries into db</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="drapeko">Roman Drapeko</reporter>
                        <labels>
                    </labels>
                <created>Sat, 19 Dec 2009 22:53:48 +0000</created>
                <updated>Thu, 23 Dec 2010 20:22:10 +0000</updated>
                                    <version>1.2.0-BETA3</version>
                                                <component>Behaviors</component>
                <component>Documentation</component>
                <component>Query</component>
                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="11405" author="drapeko" created="Sun, 17 Jan 2010 16:56:01 +0000"  >&lt;p&gt;Any comments? Will it be fixed??&lt;/p&gt;</comment>
                    <comment id="11893" author="jwage" created="Mon, 1 Mar 2010 15:52:49 +0000"  >&lt;p&gt;Hi, I&apos;d like to take a look but can you make a failing test case that I can run so that I can see if I can come up with a patch that fixes your case and doesn&apos;t break anything else.&lt;/p&gt;</comment>
                    <comment id="13087" author="lukis" created="Tue, 1 Jun 2010 13:11:16 +0000"  >&lt;p&gt;Hi&lt;/p&gt;

&lt;p&gt;I had similar problem but after several hours i did work it out&lt;/p&gt;

&lt;p&gt;Try to make get method in your model for getting field which has NULL value in database&lt;/p&gt;

&lt;p&gt;public function getUserRealId() &lt;/p&gt;
{

  return $this-&amp;gt;_get(&quot;user_real_id&quot;, false);

}

&lt;p&gt;by making second argument false u force doctrine not to lazy load value and extra sql query is not created&lt;/p&gt;

&lt;p&gt;regards&lt;/p&gt;</comment>
                    <comment id="13207" author="jwage" created="Tue, 8 Jun 2010 16:31:53 +0000"  >&lt;p&gt;Has anyone been able to reproduce this in a test case? I am not having much luck so far.&lt;/p&gt;</comment>
                    <comment id="15001" author="gena01" created="Thu, 23 Dec 2010 20:22:10 +0000"  >&lt;p&gt;I&apos;ve seen this a ton of times. Basically when it loads related records through the Hydrator using leftJoin() and gets NULLs back. BUT it doesn&apos;t save the fact that the related records are NULL. So when you actually do call to getRelated objects it sees that it doesn&apos;t have the value cached and runs the query again.&lt;/p&gt;

&lt;p&gt;Let me know if I should show you the problem in the Doctrine code base.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-489] Doctrine_Record seems to have a bug with default values when updating</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-489</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;So lets see the table:&lt;/p&gt;

&lt;p&gt;User:&lt;br/&gt;
  tableName: users&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer(1)&lt;br/&gt;
      fixed: false&lt;br/&gt;
      unsigned: true&lt;br/&gt;
      primary: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
    username:&lt;br/&gt;
      type: string(32)&lt;br/&gt;
      fixed: false&lt;br/&gt;
      unsigned: false&lt;br/&gt;
      primary: false&lt;br/&gt;
      notnull: true&lt;br/&gt;
      autoincrement: false&lt;br/&gt;
    password:&lt;br/&gt;
      type: string(48)&lt;br/&gt;
      fixed: false&lt;br/&gt;
      unsigned: false&lt;br/&gt;
      primary: false&lt;br/&gt;
      notnull: true&lt;br/&gt;
      autoincrement: false&lt;br/&gt;
    role:&lt;br/&gt;
      type: enum&lt;br/&gt;
      fixed: false&lt;br/&gt;
      unsigned: false&lt;br/&gt;
      values:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;admin&lt;/li&gt;
	&lt;li&gt;support&lt;br/&gt;
      default: support                 &amp;lt;----- &lt;span class=&quot;error&quot;&gt;Unable to render embedded object: File (ROOT OF EVIL) not found.&lt;/span&gt;&lt;br/&gt;
      primary: false&lt;br/&gt;
      notnull: true&lt;br/&gt;
      autoincrement: false&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So lets say we have a user with `role` = &apos;support&apos; and want to set em&lt;br/&gt;
&apos;admin&apos; we wrote&lt;/p&gt;

&lt;p&gt;$user = new App_Model_User();&lt;br/&gt;
$user-&amp;gt;assignIdentifier(1);&lt;br/&gt;
$user-&amp;gt;role = &apos;admin&apos;;&lt;br/&gt;
$user-&amp;gt;save();&lt;br/&gt;
var_dump($user-&amp;gt;toArray());&lt;/p&gt;

&lt;p&gt;in debugger we see SQL query been made:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0.55 ms&amp;#93;&lt;/span&gt; UPDATE users SET role = ? WHERE id = ?&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
	&lt;li&gt;bindings: admin&lt;/li&gt;
	&lt;li&gt;1&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;array(6) &lt;/p&gt;
{ [&quot;id&quot;]=&amp;gt;  int(1) [&quot;display_name&quot;]=&amp;gt;  string(13)
&quot;Administrator&quot; [&quot;username&quot;]=&amp;gt;  string(4) &quot;root&quot; [&quot;password&quot;]=&amp;gt;
string(40) &quot;45bb0f589525a2f0f2a48620bb59b1b8baef0c1d&quot; [&quot;role&quot;]=&amp;gt;
string(5) &quot;admin&quot; [&quot;is_active&quot;]=&amp;gt;  bool(true) }

&lt;p&gt;Superb! Works as it should! So lets now set role of this user back to&lt;br/&gt;
&apos;support&apos;:&lt;/p&gt;

&lt;p&gt;$user = new App_Model_User();&lt;br/&gt;
$user-&amp;gt;assignIdentifier(1);&lt;br/&gt;
$user-&amp;gt;role = &apos;support&apos;; // This value defined as default in scheme,&lt;br/&gt;
thats why have problems&lt;br/&gt;
$user-&amp;gt;save();&lt;br/&gt;
var_dump($user-&amp;gt;toArray());&lt;/p&gt;

&lt;p&gt;in debugger we didnot see any UPDATE queries! However object is been&lt;br/&gt;
changed, results just has not been flushed to database.&lt;/p&gt;

&lt;p&gt;array(6) &lt;/p&gt;
{ [&quot;id&quot;]=&amp;gt;  int(1) [&quot;display_name&quot;]=&amp;gt;  string(13)
&quot;Administrator&quot; [&quot;username&quot;]=&amp;gt;  string(4) &quot;root&quot; [&quot;password&quot;]=&amp;gt;
string(40) &quot;45bb0f589525a2f0f2a48620bb59b1b8baef0c1d&quot; [&quot;role&quot;]=&amp;gt;
string(7) &quot;support&quot; [&quot;is_active&quot;]=&amp;gt;  bool(true) }

&lt;p&gt;I cant overcome this problem right now, unfortunatelly (well I can&lt;br/&gt;
just remove all default values from table definitions or use&lt;br/&gt;
Doctrine_Query for updating staff.. but I&apos;d like to use models &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;p&gt;However if I use Doctrine_Query of even&lt;/p&gt;

&lt;p&gt;$user = Doctrine_Core::getTable(&apos;App_Model_User&apos;)-&amp;gt;find(1);&lt;/p&gt;

&lt;p&gt;instead of&lt;/p&gt;

&lt;p&gt;$user = new App_Model_User();&lt;br/&gt;
$user-&amp;gt;assignIdentifier(1);&lt;/p&gt;

&lt;p&gt;updates works well...&lt;/p&gt;</description>
                <environment>PHP 5.2.11</environment>
            <key id="10858">DC-489</key>
            <summary>Doctrine_Record seems to have a bug with default values when updating</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="silverstorm">Silver</reporter>
                        <labels>
                    </labels>
                <created>Wed, 10 Feb 2010 15:15:34 +0000</created>
                <updated>Thu, 20 Jan 2011 08:53:02 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="15153" author="elijen" created="Thu, 20 Jan 2011 08:52:31 +0000"  >&lt;p&gt;I second this.&lt;/p&gt;

&lt;p&gt;When you UPDATE row with save() method of Record after setting identifier by assignIdentifier() doctrine removes columns updates from SQL which are set to default values same as it would do with INSERT. Other columns are updated correctly. This is sure a bug.&lt;/p&gt;

&lt;p&gt;You can workaround this by setting the value as NULL instead of the actual default value. (Which I wouldn&apos;t recommend).&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-815] Model&apos;s default sorting breaks subqueries</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-815</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;It works except subqueries. Main table&apos;s order is added to subquery and vice versa. SQL query looks like this:&lt;/p&gt;

&lt;p&gt;{{&lt;br/&gt;
SELECT t.id AS t_&lt;em&gt;id FROM ticket&lt;/em&gt;_d_c9999_&lt;em&gt;record t WHERE (t.id = (SELECT MAX(t2.id) AS t2&lt;/em&gt;&lt;em&gt;0 FROM ticket&lt;/em&gt;_d_c9999__record t2 ORDER BY t.id ASC, t2.id ASC)) ORDER BY t.id ASC, t2.id ASC&lt;br/&gt;
}}&lt;/p&gt;

&lt;p&gt;Query fails because there is &amp;gt;&amp;gt;no such column &quot;t.id&quot;&amp;lt;&amp;lt;.&lt;/p&gt;

&lt;p&gt;I include a testcase when it is all visible.&lt;/p&gt;

&lt;p&gt;BTW. there is nothing about that feature (and relation orderBy) in docs. It is only in UPGRADE file.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11752">DC-815</key>
            <summary>Model&apos;s default sorting breaks subqueries</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="extreme">Jacek J&#281;drzejewski</reporter>
                        <labels>
                    </labels>
                <created>Wed, 11 Aug 2010 07:31:23 +0000</created>
                <updated>Mon, 14 Mar 2011 18:01:49 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Query</component>
                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14064" author="extreme" created="Wed, 25 Aug 2010 07:26:04 +0000"  >&lt;p&gt;Anyone?&lt;/p&gt;</comment>
                    <comment id="15487" author="beverage" created="Thu, 10 Mar 2011 08:57:34 +0000"  >&lt;p&gt;Am having the same issue!&lt;/p&gt;

&lt;p&gt;Eventually found the orderBy option on both the model and on relationships and was over joyed as I&apos;d been trying to find a way of doing this, but it didn&apos;t work!!&lt;/p&gt;

&lt;p&gt;Found the patch &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-651&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/jira/browse/DC-651&lt;/a&gt; which solved the first problem I encountered but now I&apos;m getting this.&lt;/p&gt;</comment>
                    <comment id="15498" author="beverage" created="Mon, 14 Mar 2011 18:01:49 +0000"  >&lt;p&gt;Had a look at the code and tried only setting the orderBy if the current component is actually referenced in the from sql part of the query.&lt;/p&gt;

&lt;p&gt;Looking at what is selected from, &lt;tt&gt;$this-&amp;gt;_sqlParts&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;from&amp;#39;&amp;#93;&lt;/span&gt;&lt;/tt&gt;, it appears that the main table (&lt;tt&gt;$map&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;table&amp;#39;&amp;#93;&lt;/span&gt;-&amp;gt;getTableName()&lt;/tt&gt;) and &lt;tt&gt;$sqlAlias&lt;/tt&gt; is include with a zero index and joined tables are keyed by their &lt;tt&gt;$alias&lt;/tt&gt; (or at least the content of these variables within the loop).&lt;/p&gt;

&lt;p&gt;From this I believe I could detect if the current entry in the loop was from a table that was in the current &quot;FROM&quot; part of the query by looking for the table name and alias as an entry or the current alias as a key in the &quot;FROM&quot; array.&lt;/p&gt;

&lt;p&gt;Within my sub query the orderBy valeus would still get applied but only in the subquery and not in the main query where they were included before, out of scope.&lt;/p&gt;

&lt;p&gt;With patch &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-651&quot; title=&quot;[PATCH] Doctrine_Record::option(&amp;#39;orderBy&amp;#39;, ...) of join&amp;#39;s right side being applied to refTable in m2m relationship&quot;&gt;DC-651&lt;/a&gt; applied my code in Query.php at line 1315 noew looks as follows:&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;// Note: Only include orderBy values &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; tables we&apos;re actually selecting from (both the root table or
&lt;/span&gt;                &lt;span class=&quot;code-comment&quot;&gt;// tables referenced from it)
&lt;/span&gt;                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (in_array(&lt;span class=&quot;code-quote&quot;&gt;&quot;{$map[&apos;table&apos;]-&amp;gt;getTableName()} {$sqlAlias}&quot;&lt;/span&gt;, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;from&apos;]) || array_key_exists($alias, $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_sqlParts[&apos;from&apos;])) {
                    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($map[&apos;relation&apos;])) {
                        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (isset($map[&apos;ref&apos;])) {
                            $orderBy = $map[&apos;relation&apos;][&apos;refTable&apos;]-&amp;gt;processOrderBy($sqlAlias, $map[&apos;relation&apos;][&apos;orderBy&apos;], &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
                            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($map[&apos;relation&apos;][&apos;orderBy&apos;] &amp;amp;&amp;amp; $orderBy == $map[&apos;relation&apos;][&apos;orderBy&apos;]) {
                                $orderBy = $map[&apos;relation&apos;]-&amp;gt;getOrderByStatement($sqlAlias, &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
                            }
                        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                            $orderBy = $map[&apos;relation&apos;]-&amp;gt;getOrderByStatement($sqlAlias, &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
                            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($orderBy == $map[&apos;relation&apos;][&apos;orderBy&apos;]) {
                                $orderBy = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
                            }
                        }
                    } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                        $orderBy = $map[&apos;table&apos;]-&amp;gt;getOrderByStatement($sqlAlias, &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
                    }
                } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                        $orderBy = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
                }

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

&lt;p&gt;Am I correct in my assumptions?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10735" name="DC9999TestCase.php" size="997" author="extreme" created="Wed, 11 Aug 2010 07:31:23 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-725] Call record-&gt;get(&apos;RelationManyToManyName&apos;, FALSE) corrupt the record and generate a exception when calling  record-&gt;save()</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-725</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Imagine a simple case. Contact can have many categories.&lt;br/&gt;
Doing thoses calls:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$c = Doctrine::getTable(&apos;Contact&apos;)-&amp;gt;findOneById($id);
$c-&amp;gt;get(&apos;Categories&apos;, &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;);
$c-&amp;gt;save();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Generate the following error &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;PHP Fatal error:  Call to a member function save() on a non-object in /lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/UnitOfWork.php on line 443
PHP Stack trace:
PHP   1. {main}() /test/doctrine/get_with_no_load_corrupt_many_to_many_assoc_.php:0
PHP   2. Doctrine_Record-&amp;gt;save() /test/doctrine/get_with_no_load_corrupt_many_to_many_assoc_.php:51
PHP   3. Doctrine_Connection_UnitOfWork-&amp;gt;saveGraph() /lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php:1705
PHP   4. Doctrine_Connection_UnitOfWork-&amp;gt;saveAssociations() /lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/UnitOfWork.php:137
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
</description>
                <environment>PHP 5.3.1 (cli) (built: Feb 11 2010 02:32:22) &lt;br/&gt;
mysql Ver 14.14 Distrib 5.1.41, for apple-darwin9.5.0 (i386) using readline 5.1 &lt;br/&gt;
Doctrine version 1.2.2 from SVN: &lt;a href=&quot;http://doctrine.mirror.svn.symfony-project.com/tags/1.2.2/lib/Doctrine.php&quot;&gt;http://doctrine.mirror.svn.symfony-project.com/tags/1.2.2/lib/Doctrine.php&lt;/a&gt;</environment>
            <key id="11467">DC-725</key>
            <summary>Call record-&gt;get(&apos;RelationManyToManyName&apos;, FALSE) corrupt the record and generate a exception when calling  record-&gt;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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jeanmonod">David Jeanmonod</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Jun 2010 07:50:57 +0000</created>
                <updated>Wed, 9 Jun 2010 07:55:21 +0000</updated>
                                    <version>1.2.1</version>
                <version>1.2.2</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="13249" author="jeanmonod" created="Wed, 9 Jun 2010 07:55:21 +0000"  >&lt;p&gt;Test case for the bug&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10635" name="get_with_no_load_corrupt_many_to_many_assoc_.php" size="1766" author="jeanmonod" created="Wed, 9 Jun 2010 07:55:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-934] One-to-one relationship with cascading deletion and softdelete creates empty records</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-934</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When using softdelete behaviour with cascading deletion on a one-to-one relationship, Doctrine will create a &apos;child&apos; record if it doesn&apos;t exist already, during the cascading deletion.  Eg:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Models Foo, Bar, both SoftDelete&lt;/li&gt;
	&lt;li&gt;Foo hasOne Bar&lt;/li&gt;
	&lt;li&gt;$myFoo-&amp;gt;delete()&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Result is:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;$myFoo-&amp;gt;deleted_at is set correctly as expected&lt;/li&gt;
	&lt;li&gt;New Bar record is created &amp;amp; saved in the process (but is not set to deleted)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Is this expected behaviour? I&apos;ve attached a test case script, tested against export from SVN of Doctrine 1.2.3 that demonstrates this.&lt;/p&gt;</description>
                <environment>Ubuntu 10.10, PHP 5.3.3</environment>
            <key id="12131">DC-934</key>
            <summary>One-to-one relationship with cascading deletion and softdelete creates empty records</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="richsage">Rich Sage</reporter>
                        <labels>
                    </labels>
                <created>Sun, 21 Nov 2010 11:46:56 +0000</created>
                <updated>Tue, 29 Nov 2011 13:48:49 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16927" author="marltu" created="Tue, 29 Nov 2011 13:48:49 +0000"  >&lt;p&gt;I can confirm this issue on Ubuntu 11.10 PHP 5.3.6-13ubuntu3.2 &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10872" name="testcase.php" size="2233" author="richsage" created="Sun, 21 Nov 2010 11:46:56 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-912] A method that can run in a model when the model is autoloaded</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-912</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;For my project I needed to be able to reassign connections to models when they are autoloaded &amp;#8211; this had to be able to happen during a conservative model loading process before the models had been instantiated. My solution was to build in a hook to a &quot;autoloadSetUp&quot; method which can be attached to any model (or class that is the base for a model).&lt;/p&gt;

&lt;p&gt;I will post my patch after I make a test case for it.&lt;/p&gt;

&lt;p&gt;Will Ferrer&lt;/p&gt;</description>
                <environment>XP Xamp</environment>
            <key id="12055">DC-912</key>
            <summary>A method that can run in a model when the model is autoloaded</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="willf1976">will ferrer</reporter>
                        <labels>
                    </labels>
                <created>Mon, 1 Nov 2010 20:32:14 +0000</created>
                <updated>Tue, 9 Nov 2010 19:20:06 +0000</updated>
                                                                    <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14661" author="willf1976" created="Tue, 2 Nov 2010 20:27:31 +0000"  >&lt;p&gt;made test case use a static method&lt;/p&gt;</comment>
                    <comment id="14697" author="willf1976" created="Tue, 9 Nov 2010 19:20:06 +0000"  >&lt;p&gt;fixed some compatibility issues with the test case and other test cases&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10855" name="DC_912_fix.patch" size="4403" author="willf1976" created="Tue, 9 Nov 2010 19:20:06 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-908] Can&apos;t save Doctrine Expression AES_ENCRYPT into a utf8_general_ci field</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-908</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;$membre = new Model_TMembre();&lt;br/&gt;
$membre-&amp;gt;password = new Doctrine_Expression(&quot;AES_ENCRYPT(\&quot;&quot;.htmlspecialchars($password,ENT_QUOTES).&quot;\&quot;,\&quot;&quot;._MYSQL_CRYPT.&quot;\&quot;)&quot;);&lt;br/&gt;
$membre-&amp;gt;save();&lt;/p&gt;

&lt;p&gt;Doesn&apos;t works id password field is encoded into utf8_general_ci .&lt;/p&gt;

&lt;p&gt;Works fine id password field is encoded into latin1 .&lt;/p&gt;</description>
                <environment>Win XP</environment>
            <key id="12047">DC-908</key>
            <summary>Can&apos;t save Doctrine Expression AES_ENCRYPT into a utf8_general_ci 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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="dquintard">dquintard</reporter>
                        <labels>
                    </labels>
                <created>Sun, 31 Oct 2010 08:36:36 +0000</created>
                <updated>Sun, 31 Oct 2010 08:36:36 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-893] Using default value for bigint fields generates an error</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-893</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;A field defined as:&lt;br/&gt;
&apos;user_id&apos; =&amp;gt; array(&lt;br/&gt;
 &#160; &#160;&apos;type&apos; =&amp;gt; &apos;bigint&apos;,&lt;br/&gt;
 &#160; &#160;&apos;length&apos; =&amp;gt; 22,&lt;br/&gt;
 &#160; &#160;&apos;default&apos; =&amp;gt; 0,&lt;br/&gt;
),&lt;/p&gt;

&lt;p&gt;Generates an error when create-tables is used:&lt;br/&gt;
SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &apos; &lt;span class=&quot;error&quot;&gt;&amp;#91;...&amp;#93;&lt;/span&gt; user_id bigint(22) DEFAULT , INDEX schedule_prize_id_idx (schedule_prize_id)&lt;span class=&quot;error&quot;&gt;&amp;#91;..&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;The default value is not accounted for.&lt;/p&gt;</description>
                <environment>Replicated on *nix using MySQL DB.</environment>
            <key id="12016">DC-893</key>
            <summary>Using default value for bigint fields generates an 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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="dosipov">Dan Osipov</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Oct 2010 10:56:49 +0000</created>
                <updated>Mon, 25 Oct 2010 16:27:06 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14600" author="paulovitin" created="Mon, 25 Oct 2010 16:27:06 +0000"  >&lt;p&gt;20 is the length of the mysql bigint..&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-887] disabling deep option with toArray() drops relations in result</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-887</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Using the toArray() on a Doctrine_Record object with the deep option set to true (default) correctly converts the whole object to an array including the relations.&lt;br/&gt;
But when the deep option is disabled the relations are not converted to array&apos;s (as expected) but they are lost, I would expect them to still be there in their original form (objects).&lt;/p&gt;

&lt;p&gt;I&apos;ve attached a fix. Another solution would be to add a flag that disables deep array conversion but enables relation persistence.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12004">DC-887</key>
            <summary>disabling deep option with toArray() drops relations in result</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lex">Lex Brugman</reporter>
                        <labels>
                    </labels>
                <created>Wed, 13 Oct 2010 11:06:39 +0000</created>
                <updated>Wed, 13 Oct 2010 11:06:39 +0000</updated>
                                    <version>1.2.4</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                    <attachment id="10825" name="doctrine_toarray-deep_fix.patch" size="742" author="lex" created="Wed, 13 Oct 2010 11:06:39 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-884] Doctrine_Collection::loadRelated uses getLocal instead of getLocalFieldName</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-884</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Having a camelcase fieldname with a lowercase column name causes loadRelated of doctrine collection to throw an unknown property error, fix:&lt;/p&gt;

&lt;p&gt;Change&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;$rel     = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_table-&amp;gt;getRelation($name);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($rel &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Doctrine_Relation_LocalKey || $rel &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Doctrine_Relation_ForeignKey) {
            foreach ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;data as $record) {
                $list[] = $record[$rel-&amp;gt;getLocal()];
            }
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;to:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$rel     = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_table-&amp;gt;getRelation($name);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($rel &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Doctrine_Relation_LocalKey || $rel &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Doctrine_Relation_ForeignKey) {
            foreach ($&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;data as $record) {
                $list[] = $record[$rel-&amp;gt;getLocalFieldName()];
            }
        }
&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-keyword&quot;&gt;public&lt;/span&gt; function populateRelated($name, Doctrine_Collection $coll)
    {
        $rel     = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_table-&amp;gt;getRelation($name);
        $table   = $rel-&amp;gt;getTable();
        $foreign = $rel-&amp;gt;getForeign();
        $local   = $rel-&amp;gt;getLocal();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;to&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function populateRelated($name, Doctrine_Collection $coll)
    {
        $rel     = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_table-&amp;gt;getRelation($name);
        $table   = $rel-&amp;gt;getTable();
        $foreign = $rel-&amp;gt;getForeignFieldName();
        $local   = $rel-&amp;gt;getLocalFieldName();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Windows</environment>
            <key id="11994">DC-884</key>
            <summary>Doctrine_Collection::loadRelated uses getLocal instead of getLocalFieldName</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="baxter">Jason Brumwell</reporter>
                        <labels>
                    </labels>
                <created>Mon, 11 Oct 2010 12:53:09 +0000</created>
                <updated>Mon, 18 Feb 2013 20:52:07 +0000</updated>
                                                                    <component>Record</component>
                        <due></due>
                    <votes>2</votes>
                        <watches>4</watches>
                        <comments>
                    <comment id="16574" author="eadi" created="Wed, 12 Oct 2011 07:52:56 +0000"  >&lt;p&gt;Now this is really poor. This trivial bug is known for over a year not but not yet fixed.&lt;/p&gt;

&lt;p&gt;Fixing it would save millions of rainforrest trees because people would not have to rely on hundreds of lazy loading queries per page but start to use the getRelation() method.&lt;/p&gt;</comment>
                    <comment id="18846" author="eadi" created="Thu, 18 Oct 2012 07:52:18 +0000"  >&lt;p&gt;Two years now. :&apos;-(&lt;/p&gt;</comment>
                    <comment id="19563" author="mishal" created="Mon, 18 Feb 2013 20:52:07 +0000"  >&lt;p&gt;Another year, and all people are probably on Doctrine2.&lt;/p&gt;

&lt;p&gt;But.... I just pushed your fix #&lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-884&quot; title=&quot;Doctrine_Collection::loadRelated uses getLocal instead of getLocalFieldName&quot;&gt;DC-884&lt;/a&gt; to my Doctrine1 fork, if you are interested.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mishal/doctrine1&quot; class=&quot;external-link&quot;&gt;https://github.com/mishal/doctrine1&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-882] Doctrine Collection FromArray doesn&apos;t adhere to KeyColumn</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-882</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Using the following in the base class:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;setAttribute(Doctrine_Core::ATTR_COLL_KEY, &apos;class&apos;);&lt;/p&gt;

&lt;p&gt;Then executing a query to array the indexes of the entity are not that of the class field:&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;array(
 0 =&amp;gt; ..
 1 =&amp;gt; ...
);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;fix:&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;/**
     * Populate a Doctrine_Collection from an array of data
     *
     * @param string $array 
     * @&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 fromArray($array, $deep = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
    {
        $data = array();
        foreach ($array as $rowKey =&amp;gt; $row) {
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;[$rowKey]-&amp;gt;fromArray($row, $deep);
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;to&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;/**
     * Populate a Doctrine_Collection from an array of data
     *
     * @param string $array 
     * @&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 fromArray($array, $deep = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)
    {
        $data = array();
        $keyColumn = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;keyColumn;
        foreach ($array as $rowKey =&amp;gt; $row) {
            $rowKey = $keyColumn AND isset($row[$keyColumn]) ? $row[$keyColumn] : $rowKey;
            $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;[$rowKey]-&amp;gt;fromArray($row, $deep);
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11992">DC-882</key>
            <summary>Doctrine Collection FromArray doesn&apos;t adhere to KeyColumn</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="baxter">Jason Brumwell</reporter>
                        <labels>
                    </labels>
                <created>Sat, 9 Oct 2010 11:47:46 +0000</created>
                <updated>Sat, 9 Oct 2010 11:48:38 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-845] One of our Foreign Keys is not being inserted/passed</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-845</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;We are working on a symfony/doctrine project and have come to a near halt on development.&lt;/p&gt;

&lt;p&gt;We feel that now, it may be a bug/feature in doctrine, regarding foreign keys&lt;/p&gt;

&lt;p&gt;Part of our model includes a join table that references three different table. Below is a diagram of what the model looks like, and the relevant portion of our schema.yml is at the bottom.&lt;/p&gt;

&lt;p&gt;Image of our schema: &lt;a href=&quot;http://imgur.com/dfFYI.png&quot; class=&quot;external-link&quot;&gt;http://imgur.com/dfFYI.png&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have a form that contains a set of embedded forms that attempt to create a new Person entry and add rows to the join table, adding items to the PersonName table as needed.&lt;/p&gt;

&lt;p&gt;The form attempts to do this by creating and saving PersonName objects with NameType parameters, but are running into the problem of Doctrine not including that column when trying to do an insert into the join table.&lt;/p&gt;

&lt;p&gt;Part of the problem seems to be caused by the Doctrine_Connection_UnitOfWork::saveAssociations method:&lt;/p&gt;

&lt;p&gt;                foreach ($v-&amp;gt;getInsertDiff() as $r) &lt;/p&gt;
{
                    $assocRecord = $assocTable-&amp;gt;create();
                    $assocRecord-&amp;gt;set($assocTable-&amp;gt;getFieldName($rel-&amp;gt;getForeign()), $r);
                    $assocRecord-&amp;gt;set($assocTable-&amp;gt;getFieldName($rel-&amp;gt;getLocal()), $record);
                    $this-&amp;gt;saveGraph($assocRecord);
                }

&lt;p&gt;Are we correct in understanding that this means that Doctrine 1.2 does not support tables with multiple foreign keys in this scenario?&lt;/p&gt;


&lt;p&gt;Here is the relevant portion of schema.yml:&lt;/p&gt;

&lt;p&gt;agPerson: &lt;br/&gt;
  columns: &lt;br/&gt;
    id: &lt;br/&gt;
      primary: true &lt;br/&gt;
      type: integer(5) &lt;br/&gt;
      autoincrement: true &lt;br/&gt;
  relations: &lt;br/&gt;
    agPersonName: &lt;br/&gt;
      class: agPersonName &lt;br/&gt;
      refClass: agPersonMjAgPersonName &lt;br/&gt;
      local: person_id &lt;br/&gt;
      foreign: person_name_id &lt;br/&gt;
    agPersonNameType: &lt;br/&gt;
      class: agPersonNameType &lt;br/&gt;
      refClass: agPersonMjAgPersonName &lt;br/&gt;
      local: person_id &lt;br/&gt;
      foreign: person_name_type_id &lt;br/&gt;
agPersonNameType: &lt;br/&gt;
  columns: &lt;br/&gt;
    id: &lt;br/&gt;
      primary: true &lt;br/&gt;
      type: integer(2) &lt;br/&gt;
      autoincrement: true &lt;br/&gt;
    person_name_type: &lt;br/&gt;
      unique: true &lt;br/&gt;
      type: string(30) &lt;br/&gt;
      notnull: true &lt;br/&gt;
    app_display: &lt;br/&gt;
      default: 1 &lt;br/&gt;
      type: boolean &lt;br/&gt;
      notnull: true &lt;br/&gt;
  relations: &lt;br/&gt;
    agPerson: &lt;br/&gt;
      class: agPerson &lt;br/&gt;
      refClass: agPersonMjAgPersonName &lt;br/&gt;
      local: person_name_type_id &lt;br/&gt;
      foreign: person_id &lt;br/&gt;
    agPersonName: &lt;br/&gt;
      class: agPersonName &lt;br/&gt;
      refClass: agPersonMjAgPersonName &lt;br/&gt;
      local: person_name_type_id &lt;br/&gt;
      foreign: person_name_id &lt;br/&gt;
agPersonName: &lt;br/&gt;
  columns: &lt;br/&gt;
    id: &lt;br/&gt;
      primary: true &lt;br/&gt;
      type: integer(5) &lt;br/&gt;
      autoincrement: true &lt;br/&gt;
    person_name: &lt;br/&gt;
      unique: true &lt;br/&gt;
      type: string(64) &lt;br/&gt;
      notnull: true &lt;br/&gt;
  relations: &lt;br/&gt;
    agPerson: &lt;br/&gt;
      class: agPerson &lt;br/&gt;
      refClass: agPersonMjAgPersonName &lt;br/&gt;
      local: person_name_id &lt;br/&gt;
      foreign: person_id &lt;br/&gt;
    agPersonNameType: &lt;br/&gt;
      class: agPersonNameType &lt;br/&gt;
      refClass: agPersonMjAgPersonName &lt;br/&gt;
      local: person_name_id &lt;br/&gt;
      foreign: person_name_type_id &lt;br/&gt;
agPersonMjAgPersonName: &lt;br/&gt;
  columns: &lt;br/&gt;
    id: &lt;br/&gt;
      primary: true &lt;br/&gt;
      type: integer(5) &lt;br/&gt;
      autoincrement: true &lt;br/&gt;
    person_id: &lt;br/&gt;
      type: integer(5) &lt;br/&gt;
      notnull: true &lt;br/&gt;
    person_name_id: &lt;br/&gt;
      type: integer(5) &lt;br/&gt;
      notnull: true &lt;br/&gt;
    person_name_type_id: &lt;br/&gt;
      type: integer(2) &lt;br/&gt;
      notnull: true &lt;br/&gt;
    is_primary: &lt;br/&gt;
      type: boolean &lt;br/&gt;
      notnull: true &lt;br/&gt;
  indexes: &lt;br/&gt;
    UX_ag_person_mj_ag_person_name: &lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;person_name_id, person_name_type_id, person_id&amp;#93;&lt;/span&gt; &lt;br/&gt;
      type: unique &lt;br/&gt;
  relations: &lt;br/&gt;
    agPerson: &lt;br/&gt;
      local: person_id &lt;br/&gt;
      foreign: id &lt;br/&gt;
    agPersonName: &lt;br/&gt;
      local: person_name_id &lt;br/&gt;
      foreign: id &lt;br/&gt;
    agPersonNameType: &lt;br/&gt;
      local: person_name_type_id &lt;br/&gt;
      foreign: id &lt;br/&gt;
actAs: &lt;br/&gt;
  Timestampable: &lt;/p&gt;



&lt;p&gt;As a caveat: we&apos;ve noticed that sfdoctrineguard group table, has such a relationship:&lt;/p&gt;

&lt;p&gt;mysql&amp;gt; describe sf_guard_user_group;&lt;br/&gt;
&lt;ins&gt;-----------&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;--------&lt;del&gt;&lt;ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;---&lt;del&gt;&lt;ins&gt;&lt;/del&gt;-------&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;------+&lt;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Field      &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Type     &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Null &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Key &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Default &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; Extra &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;&lt;ins&gt;-----------&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;--------&lt;del&gt;&lt;ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;---&lt;del&gt;&lt;ins&gt;&lt;/del&gt;-------&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;------+&lt;/p&gt;
&lt;table class=&apos;confluenceTable&apos;&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; user_id    &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; int(11)  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NO   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; PRI &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0       &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; group_id   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; int(11)  &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NO   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; PRI &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; 0       &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; created_at &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; datetime &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NO   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NULL    &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; updated_at &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; datetime &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NO   &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt; NULL    &lt;/td&gt;
&lt;td class=&apos;confluenceTd&apos;&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;&lt;ins&gt;-----------&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;--------&lt;del&gt;&lt;ins&gt;&lt;/del&gt;----&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;---&lt;del&gt;&lt;ins&gt;&lt;/del&gt;-------&lt;del&gt;&lt;/ins&gt;&lt;/del&gt;------+&lt;/p&gt;


&lt;p&gt;i.e. IT has two foreign keys taken into account&lt;/p&gt;</description>
                <environment>Linux ubuntu 2.6.31-22-generic #63-Ubuntu SMP Thu Aug 19 00:23:50 UTC 2010 x86_64 GNU/Linux&lt;br/&gt;
PHP 5.2.10-2ubuntu6.4 with Suhosin-Patch 0.9.7 (cli) (built: Jan  6 2010 22:56:44) &lt;br/&gt;
mysql  Ver 14.14 Distrib 5.1.37, for debian-linux-gnu (x86_64) using  EditLine wrapper</environment>
            <key id="11840">DC-845</key>
            <summary>One of our Foreign Keys is not being inserted/passed</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="zelaz">charles wisniewski</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 Aug 2010 12:06:42 +0000</created>
                <updated>Fri, 27 Aug 2010 12:06:42 +0000</updated>
                                    <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                                                <component>Record</component>
                <component>Relations</component>
                <component>Transactions</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1011] wierd behaviour with setTableName - table name doesn&apos;t get set</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1011</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;if i create class called Attribute_set that extends Doctrine_Record and setTableName in setUpTableDefinintion like in documentation setting up models section, the table name appears not to be set&lt;br/&gt;
getTableName returns &quot;doctrine_&lt;em&gt;record&lt;/em&gt;_abstract&quot;&lt;/p&gt;

&lt;p&gt;any joins or relations fail.&lt;/p&gt;

&lt;p&gt;if i set it in the setUp function the setTableName appear working and returns &quot;attribute_sets&quot; table name. This only happens with this particular class, and relations have no effect.&lt;/p&gt;

&lt;p&gt;I attached class example i&apos;m expiriencing problems with, that should help reproducte this issue&lt;/p&gt;</description>
                <environment>Linux 2.6.35-28-generic #50-Ubuntu SMP Fri Mar 18 19:00:26 UTC 2011 i686 GNU/Linux&lt;br/&gt;
PHP 5.3.3-1ubuntu9.5</environment>
            <key id="12758">DC-1011</key>
            <summary>wierd behaviour with setTableName - table name doesn&apos;t get set</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="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gamesh">Justinas</reporter>
                        <labels>
                    </labels>
                <created>Tue, 28 Jun 2011 08:58:55 +0000</created>
                <updated>Tue, 28 Jun 2011 13:03:34 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="16087" author="gamesh" created="Tue, 28 Jun 2011 09:56:07 +0000"  >&lt;p&gt;fixed misstype and it appears that it was not the problem, i get the same:&lt;/p&gt;

&lt;p&gt;Base table or view not found: 1146 Table &apos;db.doctrine_&lt;em&gt;record&lt;/em&gt;_abstract&apos; doesn&apos;t exist&lt;/p&gt;

&lt;p&gt;maybe attribute_set is somekind reserved word in doctrine library ?&lt;/p&gt;</comment>
                    <comment id="16089" author="gamesh" created="Tue, 28 Jun 2011 13:03:34 +0000"  >&lt;p&gt;the problem appears to come from Doctrine Formatter&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11018" name="attribute_set.php" size="750" author="gamesh" created="Tue, 28 Jun 2011 09:56:40 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-979] Doctrine save() only checks one level deep on one-to-one relations.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-979</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Updating/saving an object fails when trying to update the nth-level of an existing object/relation where n is more than one level away from the root node of one-to-one relation chain.  For example, with the yaml model below the following does not update the name of the Company object:&lt;/p&gt;

&lt;p&gt;Image-&amp;gt;Product-&amp;gt;Category-&amp;gt;Company-&amp;gt;name = &quot;Acme&quot;.&lt;/p&gt;

&lt;p&gt;If &quot;Product&quot; has no changes it appears to stop checking for changes there.  If we do a save on a one-to-many relation chain such as the following, it works fine:&lt;/p&gt;

&lt;p&gt;Company-&amp;gt;Category-&amp;gt;Product-&amp;gt;Image-&amp;gt;name = &quot;image1.jpg&quot;   &lt;/p&gt;

&lt;p&gt;I was able to fix this issue by modifying the saveRelatedLocalKeys() function in UnitOfWork.php to use isModified() with deep=true:&lt;/p&gt;

&lt;p&gt;if ($obj instanceof Doctrine_Record &amp;amp;&amp;amp; $obj-&amp;gt;isModified(true)) {&lt;/p&gt;

&lt;p&gt;This works but I&apos;m not sure if changing this has any repercussions on more complex queries.&lt;/p&gt;


&lt;p&gt;&amp;#8212;&lt;br/&gt;
detect_relations: true&lt;br/&gt;
options:&lt;br/&gt;
  collate: utf8_general_ci&lt;br/&gt;
  charset: utf8&lt;br/&gt;
  type: InnoDB&lt;/p&gt;

&lt;p&gt;Company:&lt;br/&gt;
  tableName: Company&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      primary: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
    name:&lt;br/&gt;
      type: string(45)&lt;/p&gt;

&lt;p&gt;Category:&lt;br/&gt;
  tableName: Category&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      primary: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
    companyId:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      notnull: true&lt;br/&gt;
    name:&lt;br/&gt;
      type: string(45)&lt;br/&gt;
  relations:&lt;br/&gt;
    Company:&lt;br/&gt;
      class: Company&lt;br/&gt;
      local: companyId&lt;br/&gt;
      foreign: id&lt;br/&gt;
      foreignAlias: categories&lt;br/&gt;
      onDelete: cascade&lt;br/&gt;
      onUpdate: cascade&lt;br/&gt;
  indexes:&lt;br/&gt;
    fk_Category_Company1:&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;companyId&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Product:&lt;br/&gt;
  tableName: Product&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      primary: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
    categoryId:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      notnull: true&lt;br/&gt;
    name:&lt;br/&gt;
      type: string(45)&lt;br/&gt;
  relations:&lt;br/&gt;
    Category:&lt;br/&gt;
      class: Category&lt;br/&gt;
      local: categoryId&lt;br/&gt;
      foreign: id&lt;br/&gt;
      foreignAlias: products&lt;br/&gt;
      onDelete: cascade&lt;br/&gt;
      onUpdate: cascade&lt;br/&gt;
  indexes:&lt;br/&gt;
    fk_Product_Category1:&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;categoryId&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Image:&lt;br/&gt;
  tableName: Image&lt;br/&gt;
  columns:&lt;br/&gt;
    id:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      primary: true&lt;br/&gt;
      notnull: true&lt;br/&gt;
      autoincrement: true&lt;br/&gt;
    productId:&lt;br/&gt;
      type: integer(4)&lt;br/&gt;
      notnull: true&lt;br/&gt;
    name:&lt;br/&gt;
      type: string(45)&lt;br/&gt;
  relations:&lt;br/&gt;
    Product:&lt;br/&gt;
      class: Product&lt;br/&gt;
      local: productId&lt;br/&gt;
      foreign: id&lt;br/&gt;
      foreignAlias: images&lt;br/&gt;
      onDelete: cascade&lt;br/&gt;
      onUpdate: cascade&lt;br/&gt;
  indexes:&lt;br/&gt;
    fk_Image_Product1:&lt;br/&gt;
      fields: &lt;span class=&quot;error&quot;&gt;&amp;#91;productId&amp;#93;&lt;/span&gt;&lt;/p&gt;
</description>
                <environment>MySQL 5.1.38, PHP 5.3.3</environment>
            <key id="12435">DC-979</key>
            <summary>Doctrine save() only checks one level deep on one-to-one relations.</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="cesaric">Robert Cesaric</reporter>
                        <labels>
                    </labels>
                <created>Sun, 27 Feb 2011 23:36:08 +0000</created>
                <updated>Sun, 27 Feb 2011 23:36:08 +0000</updated>
                                    <version>1.2.1</version>
                <version>1.2.2</version>
                <version>1.2.3</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-967] Problems with fetchArray() combined with leftJoin() by using  aliases of columns</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-967</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;They are some strange problems with hydration to array combined with aliases of columns and JOINS. Let&apos;s see this 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;$q = Doctrine_Query::create ()
-&amp;gt;select(&apos;c.id AS id, c.path AS path, c.name AS name, cbc.product_count&apos;)
-&amp;gt;from(&apos;Category c&apos;)
-&amp;gt;leftJoin(&apos;c.CategoryBrowserCache cbc&apos;);

$categories = $q-&amp;gt;fetchArray();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This example will throw exception: &quot;The root class of the query (alias lc) must have at least one field selected.&quot;&lt;/p&gt;

&lt;p&gt;OK. Let&apos;s change code  a little bit. Let&apos;s add alias for cbc.product_count column too:&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;$q = Doctrine_Query::create ()
-&amp;gt;select(&apos;c.id AS id, c.path AS path, c.name AS name, cbc.product_count AS product_count&apos;)
-&amp;gt;from(&apos;Category c&apos;)
-&amp;gt;leftJoin(&apos;c.CategoryBrowserCache cbc&apos;);

$categories = $q-&amp;gt;fetchArray();
print_r($categories);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now code executed without exception, BUT  $q-&amp;gt;fetchArray()  returned only ONE (first) record hydrated to array. Other results were ignored.  &lt;/p&gt;

&lt;p&gt;Let&apos;s change code  one more 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;$q = Doctrine_Query::create ()
-&amp;gt;select(&apos;c.id, c.path, c.name, cbc.product_count AS product_count&apos;)
-&amp;gt;from(&apos;Category c&apos;)
-&amp;gt;leftJoin(&apos;c.CategoryBrowserCache cbc&apos;);
$categories = $q-&amp;gt;fetchArray();
print_r($categories);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Like you see I just removed all aliases for columns for Category. Now code will be executed without exceptions, All results will be hydrated into array as expected to be. Actually the same result can be reached by removing at least one alias for any Category column. &lt;/p&gt;</description>
                <environment>Symfony Framework v1.3.8, Windows 7</environment>
            <key id="12385">DC-967</key>
            <summary>Problems with fetchArray() combined with leftJoin() by using  aliases of columns</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="guilhermeblanco">Guilherme Blanco</assignee>
                                <reporter username="arnlukas">Arnoldas Lukasevicius</reporter>
                        <labels>
                    </labels>
                <created>Sun, 13 Feb 2011 18:30:56 +0000</created>
                <updated>Sun, 13 Feb 2011 18:46:58 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-961] Copy uses mutators but does not use accessors</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-961</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have a column that contains a serialized string of data. The accessor for that column unserializes the data and the mutator serializes. When calling copy the accessor is not used but the mutator is causing the mutator to fail because it receives a string instead of an object as its value.&lt;/p&gt;

&lt;p&gt;The lines of code creating this problem follow:&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;Record.php&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-keyword&quot;&gt;public&lt;/span&gt; function copy($deep = &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;)
 {
    $data = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_data; &lt;span class=&quot;code-comment&quot;&gt;//does not use accessor
&lt;/span&gt;...
    $ret = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_table-&amp;gt;create($data); &lt;span class=&quot;code-comment&quot;&gt;// does use mutator
&lt;/span&gt;...
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I have currently patched my copy function with the following:&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;// $data = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;_data
&lt;/span&gt;$data = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;toArray(&lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="12334">DC-961</key>
            <summary>Copy uses mutators but does not use accessors</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="shagreel">Paul Jones</reporter>
                        <labels>
                    </labels>
                <created>Fri, 28 Jan 2011 13:39:23 +0000</created>
                <updated>Fri, 28 Jan 2011 15:42:06 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1056] Doctrine is not compatible with PHP 5.4 due to change in serialize() behaviour.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1056</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;In PHP 5.4 there is a change in the way the object references are serialized:&lt;/p&gt;

&lt;p&gt;Quote:&lt;br/&gt;
&quot;Support for object references in recursive serialize() calls&lt;br/&gt;
Prior to PHP 5.4, object references where not saved in recursive serialize calls.&quot;&lt;/p&gt;

&lt;p&gt;This minor change, breaks down serialization of collections when column of type &quot;array&quot; is present - double serialization occurs.&lt;br/&gt;
I&apos;m attaching a patch fixing the issue.&lt;/p&gt;
</description>
                <environment>PHP 5.4+</environment>
            <key id="13751">DC-1056</key>
            <summary>Doctrine is not compatible with PHP 5.4 due to change in serialize() behaviour.</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mg">Marcin Gil</reporter>
                        <labels>
                    </labels>
                <created>Mon, 4 Jun 2012 08:03:39 +0000</created>
                <updated>Mon, 28 Jan 2013 19:45:13 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Record</component>
                <component>Relations</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="18837" author="colin.darie" created="Mon, 15 Oct 2012 14:02:29 +0000"  >&lt;p&gt;I confirm for possible future readers: this patch works perfectly well. (cf github for several forks of doctrine with other bugfixes).&lt;/p&gt;</comment>
                    <comment id="19430" author="st3b3n" created="Sun, 27 Jan 2013 19:10:57 +0000"  >&lt;p&gt;Hi all, does somebody knows where can I get a copy of the Doctrine 1.2.4 version but running on php 5.4?&lt;br/&gt;
Thise version you&apos;re talking about&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    <comment id="19431" author="mg" created="Mon, 28 Jan 2013 08:05:59 +0000"  >&lt;p&gt;I sent you URL to our private svn repo.&lt;/p&gt;</comment>
                    <comment id="19432" author="st3b3n" created="Mon, 28 Jan 2013 19:45:13 +0000"  >&lt;p&gt;Thanks, you&apos;ve saved mi life &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/biggrin.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>
                    <attachment id="11197" name="Record.php.patch" size="1032" author="mg" created="Mon, 4 Jun 2012 13:59:32 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-453] Joined records stated as dirty (whereas they are not modified)</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-453</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When you retrieve records like this:&lt;/p&gt;

&lt;p&gt;(Here I have Labels, that have Albums)&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;    $lab = Doctrine::getTable(&apos;Label&apos;)-&amp;gt;createQuery(&apos;lab&apos;)&lt;br/&gt;
      -&amp;gt;leftJoin(&apos;lab.Albums alb&apos;)&lt;br/&gt;
      -&amp;gt;select(&apos;lab.id, alb.id&apos;)&lt;br/&gt;
      -&amp;gt;where(&apos;lab.id = ?&apos;, 1)&lt;br/&gt;
      -&amp;gt;fetchOne();&lt;/p&gt;&lt;/blockquote&gt; 

&lt;p&gt;$lab-&amp;gt;state() is STATE_PROXY : it&apos;s ok, properties are not all loaded from the DB and the object is not modified&lt;/p&gt;

&lt;p&gt;BUT $lab-&amp;gt;Albums&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;-&amp;gt;state() is STATE_DIRTY : why ? the object is not modified...&lt;/p&gt;

&lt;p&gt;This causes real problems, because this way, joined objects unloaded properties are corrupted : it really behaves like they all are &quot;null&quot;, and that&apos;s all. Their real values are never loaded from the DB.&lt;/p&gt;</description>
                <environment></environment>
            <key id="10780">DC-453</key>
            <summary>Joined records stated as dirty (whereas they are not modified)</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="theredled">Beno&#238;t Guchet</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 Jan 2010 10:31:37 +0000</created>
                <updated>Thu, 29 Jul 2010 15:58:54 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12244" author="theredled" created="Mon, 15 Mar 2010 16:51:14 +0000"  >&lt;p&gt;No way to correct that ?&lt;/p&gt;</comment>
                    <comment id="12245" author="jwage" created="Mon, 15 Mar 2010 16:54:24 +0000"  >&lt;p&gt;Can you provide a test case? are you sure it is dirty or you had the object instance prior to the query and it was dirty there?&lt;/p&gt;</comment>
                    <comment id="12248" author="theredled" created="Mon, 15 Mar 2010 17:09:30 +0000"  >&lt;p&gt;Actually the given sample code is written to be a test case (Label/Albums can be any other basic Parent/Children relation). &lt;br/&gt;
You retrieve an object, join a child relation, selects only some fields from the children =&amp;gt; those children are Dirty.&lt;/p&gt;

&lt;p&gt;Yes I&apos;m sure it is dirty, the Album object does not exist before that, the script does nothing else than this query. The object was born dirty, so to speak.&lt;/p&gt;</comment>
                    <comment id="12249" author="jwage" created="Mon, 15 Mar 2010 17:12:41 +0000"  >&lt;p&gt;Sorry, I meant a Doctrine unit test case. Not just some pasted code in the issue.&lt;/p&gt;</comment>
                    <comment id="13731" author="mstrzele" created="Thu, 29 Jul 2010 15:58:54 +0000"  >&lt;p&gt;I have the same problem, but I have a deeper relation. The clue of it is that, that  in Albums&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt; is setting id of relation with lab.id (cause of that change STATE_DIRTY is set), and after that operation getModiefied method return array with one element &lt;br/&gt;
array(&lt;br/&gt;
  id =&amp;gt; lab.id&lt;br/&gt;
)&lt;/p&gt;

&lt;p&gt;The bug is that, that in releted object after hydration setting releted id changing state of record -&amp;gt; it is wrong behavior, becaus nothing changed -&amp;gt; record has releted id with value, which is exactly the same as in DB.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-326] Running out of memory while executing single record lookup.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-326</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have the model class as follows:&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;schema.yml&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;options:
  collate: utf8_unicode_ci
  charset: utf8
  type: INNODB
Identity:
  tableName: Identity
  columns:
    id:
      type: integer(4)
      fixed: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
    username:
      type: string(50)
      fixed: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      primary: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
    email:
      type: string(50)
      fixed: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      primary: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
    password:
      type: string(100)
      fixed: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      primary: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
    created_at:
      name: created_at
      type: timestamp
      # &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;: CURRENT_TIMESTAMP
      fixed: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      primary: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
    updated_at:
      name: updated_at
      type: timestamp
      fixed: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      primary: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
  relations:
    Roles:
      class: Role
      local: id
      foreign: ident_id
      type: many
    Token:
      local: id
      foreign: entity_id
      type: many
    Devices:
      class: Device
      local: id
      foreign: account_id
      type: many
    Rides:
      class: Ride
      local: id
      foreign: account_id
      type: many
    OwnGroups:
      class: CoachGroup
      local: id
      foreign: owner_id
      type: many
    GroupMemberships:
      class: GroupMembership
      local: id
      foreign: ident_id
      type: many
  actAs:
    Timestampable:
      created:
        name: created_at
        type: timestamp
        expression: NOW()
      update:
        onInsert: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
Role:
  tableName: Role
  columns:
    identId:
      name: ident_id
      type: integer(4)
      fixed: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
    role:
      type: string(50)
      fixed: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
  relations:
    Identity:
      onDelete: CASCADE
      onUpdate: CASCADE
      local: ident_id
      foreign: id
      foreignAlias: Roles
Token:
  tableName: Token
  columns:
    entity_id:
      name: entity_id
      type: integer(4)
      fixed: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      primary: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
    token:
      name: token
      type: string(50)
      fixed: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      primary: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;: &apos;&apos;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
    type:
      type: &lt;span class=&quot;code-keyword&quot;&gt;enum&lt;/span&gt;(50)
      fixed: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      values:
        - EMAIL_VERIFICATION
        - PASS_RESET
      primary: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      &lt;span class=&quot;code-keyword&quot;&gt;default&lt;/span&gt;: EMAIL_VERIFICATION
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
    created_at:
      type: timestamp(25)
      fixed: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      primary: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
    expires_at:
      type: timestamp(25)
      fixed: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      unsigned: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      primary: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      notnull: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
      autoincrement: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;
  indexes:
    entity:
      fields: [entity_id]
  relations:
    Identity:
      onDelete: CASCADE
      onUpdate: CASCADE
      local: entity_id
      foreign: id
      type: one
  actAs:
    Timestampable:
      created:
        name: created_at
        type: timestamp
      updated:
        disabled: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and my unit test for the model:&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;TokenModelTest.php&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;$t = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; lime_test(3);
$t-&amp;gt;diag(&lt;span class=&quot;code-quote&quot;&gt;&quot;=== Token model test ===&quot;&lt;/span&gt;);

$t-&amp;gt;info(&apos;Token creation =&amp;gt;&apos;);
$token = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Token();
$token-&amp;gt;setEntityId(1);
$token-&amp;gt;generateUniqueToken();

$t-&amp;gt;info(&apos;Set valid token type...&apos;);
$token-&amp;gt;setType(Token::TYPE_EMAIL_VERIFICATION);
&lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt;{
  $t-&amp;gt;info(&apos;Saving the token...&apos;);
  $token-&amp;gt;save();
  $t-&amp;gt;pass(&apos;Token was saved successfully...&apos;);
}
&lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt;(Exception $e){
  $t-&amp;gt;is(($e &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Exception), &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, $e-&amp;gt;getMessage());
}

$t-&amp;gt;isnt($token-&amp;gt;getCreatedAt(), &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, &apos; Creation datetime is set to &apos;.$token-&amp;gt;getCreatedAt().&apos;...&apos;);

$t-&amp;gt;info(&apos;Get &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; token from DB...&apos;);
$tokenFromDb = Doctrine::getTable(&apos;Token&apos;)-&amp;gt;findOneByToken($token-&amp;gt;getToken());

$t-&amp;gt;info(&apos;Compare the two...&apos;);
$t-&amp;gt;is($tokenFromDb-&amp;gt;getEntityId(), $token-&amp;gt;getEntityId(), &apos;Entity ID...&apos;);
$t-&amp;gt;is($tokenFromDb-&amp;gt;getToken(), $token-&amp;gt;getToken(), &apos;Token string...&apos;);
$t-&amp;gt;is($tokenFromDb-&amp;gt;getType(), $token-&amp;gt;getType(), &apos;Token string...&apos;);
$t-&amp;gt;is($tokenFromDb-&amp;gt;getCreatedAt(), $token-&amp;gt;getCreatedAt(), &apos;Token creation date...&apos;);
$t-&amp;gt;is($tokenFromDb-&amp;gt;getExpiresAt(), $token-&amp;gt;getExpiresAt(), &apos;Token expration date...&apos;);
$t-&amp;gt;is($tokenFromDb-&amp;gt;getExpiresAt(), &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;, &apos;Token expration date is &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;...&apos;);

$t-&amp;gt;info(&apos;Delete token...&apos;);
$t-&amp;gt;is($token-&amp;gt;delete(), &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, &apos;Successful deletion...&apos;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;On test execution on 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;$tokenFromDb = Doctrine::getTable(&apos;Token&apos;)-&amp;gt;findOneByToken($token-&amp;gt;getToken());
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I&apos;m getting a fatal error:&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;ERROR&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;# === Token model test ===
&amp;gt; Token creation =&amp;gt;
&amp;gt; Set valid token type...
&amp;gt; Saving the token...
ok 1 - Token was saved successfully...
ok 2 -  Creation datetime is set to 2009-12-04 01:13:31...
&amp;gt; Get &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; token from DB...
PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 261900 bytes) in /ApacheWebServer/htdocs/Clients/enki/enkiweb/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Core.php on line 550

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 261900 bytes) in /ApacheWebServer/htdocs/Clients/enki/enkiweb/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Core.php on line 550
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Mac OS 10.5, Zend Server CE, PHP 5.3&lt;br/&gt;
Symfony 1.4</environment>
            <key id="10563">DC-326</key>
            <summary>Running out of memory while executing single record lookup.</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="shurikag">Alex Agulyansky</reporter>
                        <labels>
                    </labels>
                <created>Fri, 4 Dec 2009 09:15:16 +0000</created>
                <updated>Mon, 7 Dec 2009 21:06:03 +0000</updated>
                                    <version>1.2.0</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11067" author="jwage" created="Mon, 7 Dec 2009 21:06:03 +0000"  >&lt;p&gt;Anymore information? Not much I can really do right now. If you have some more information to help I can look at the problem again. A Doctrine test case would be helpful.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-280] Add pre/postHydrateResultSet() events</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-280</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Over the last several weeks I&apos;ve been working on streamlining the access control logic in the application I&apos;m working on, and I realized that Doctrine&apos;s event listeners might be able to help.  For more detailed background information take a look at &lt;a href=&quot;http://groups.google.com:80/group/dallasphp/browse_thread/thread/91e3f107cd611adf&quot; class=&quot;external-link&quot;&gt;http://groups.google.com:80/group/dallasphp/browse_thread/thread/91e3f107cd611adf&lt;/a&gt; ...but here&apos;s the problem in a nutshell:&lt;/p&gt;

&lt;p&gt;Since my application&apos;s access control logic is all implemented in PHP rather than in the database (i.e., I can&apos;t add access control to my queries as a simple WHERE clause), I&apos;m looking for a way to hook into the query process just after the records have been hydrated and actually modify the result set that gets returned, such that only permissible records show up in the final result set.&lt;/p&gt;

&lt;p&gt;Unfortunately, although there are several listener methods that look promising for this, none of them seem to have access to the data being returned.  For instance, if I run a custom query via Doctrine_Query::execute(), the postQuery() hook definitely runs ...but it doesn&apos;t give me access to anything but the query string itself.&lt;/p&gt;

&lt;p&gt;Since, in some instances (e.g., hydration listeners), the Doctrine_Event object is assigned arbitrary data that the listener can modify, I&apos;m wondering if the same thing couldn&apos;t be done more universally?&lt;/p&gt;</description>
                <environment></environment>
            <key id="10495">DC-280</key>
            <summary>Add pre/postHydrateResultSet() events</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jazzslider">Adam Jensen</reporter>
                        <labels>
                    </labels>
                <created>Mon, 23 Nov 2009 23:38:02 +0000</created>
                <updated>Tue, 8 Jun 2010 16:09:38 +0000</updated>
                                                                    <component>Connection</component>
                <component>Query</component>
                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10829" author="jwage" created="Tue, 24 Nov 2009 00:01:06 +0000"  >&lt;p&gt;In Doctrine 1.2 you can create custom hydrators. You can extend the core hydrators to remove the data you want? I think that would work.&lt;/p&gt;</comment>
                    <comment id="10846" author="jazzslider" created="Tue, 24 Nov 2009 19:45:06 +0000"  >&lt;p&gt;Sure enough, that does the trick!&lt;/p&gt;

&lt;p&gt;There are a couple of downsides, though, that might be worth considering in terms of future development:&lt;/p&gt;

&lt;p&gt;1. It would be nice to be able to specify constructor arguments for the hydrator, so that collaborators can be injected.  In my example, the hydrator needs access to the application&apos;s access control list object; currently it&apos;s simply retrieving it from a global registry, but it would be nice for testing&apos;s sake to be able to inject it instead.&lt;br/&gt;
2. It would also be nice to be able to chain multiple hydrators together; that&apos;s one reason I was looking at listeners, since they&apos;ve got that capability already.  That approach allows you to keep distinct behavior distinct a lot more easily.&lt;/p&gt;

&lt;p&gt;Ultimately, I&apos;d still kind of like to see another listener method available ...say, preHydrateResultSet() and postHydrateResultSet()?  I think that would be a more flexible approach, even though the custom hydrator solution works quite well.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;br/&gt;
Adam&lt;/p&gt;</comment>
                    <comment id="10847" author="jwage" created="Tue, 24 Nov 2009 19:49:31 +0000"  >&lt;p&gt;I like the idea. I&apos;ll move this to 1.3. I don&apos;t think we&apos;re gonna have a 1.3 version but if we do, it&apos;ll be there.&lt;/p&gt;</comment>
                    <comment id="12211" author="jwage" created="Mon, 15 Mar 2010 14:22:57 +0000"  >&lt;p&gt;We can include this in a 1.2.x release if you would like to provide a patch and some tests. Thanks, Jon&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-684] After adding a Reference, the ForeignKeys in the DB are not updatet</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-684</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;After query a record from the DB, where a foreign key is null, and changing only the reference belonging to this foreign key, and only these reference no other value of the record, a save of the record doesn&apos;t lead to a change in the foreign key field.&lt;/p&gt;

&lt;p&gt;For example: I&apos;ll save a user record with some data of a regestration and give him the possibillity to add a city where he cames from later in his account settings, if no other user attribute is changed, the state of the user record is still CLEAN. The result is that I can access the user-&amp;gt;City property correctly only as long as no refresh from the db is done. So the changing of the foreign key belonging to the city isn&apos;t persistent in the DB.&lt;/p&gt;

&lt;p&gt;Example Code:&lt;br/&gt;
		$user = new Model_User();&lt;br/&gt;
		$user-&amp;gt;firstName = md5(rand());&lt;br/&gt;
		$user-&amp;gt;save();&lt;/p&gt;

&lt;p&gt;		$id = $user-&amp;gt;id;&lt;br/&gt;
		unset($user);&lt;br/&gt;
		assert(! $user);&lt;/p&gt;

&lt;p&gt;		$user = Model_UserTable::getInstance()-&amp;gt;find($id);&lt;br/&gt;
		assert(!$user-&amp;gt;relatedExists(&apos;City&apos;));		&lt;/p&gt;

&lt;p&gt;		$user-&amp;gt;City-&amp;gt;name = &apos;Mainz&apos;;&lt;br/&gt;
		$user-&amp;gt;save();&lt;br/&gt;
		unset($user);&lt;/p&gt;

&lt;p&gt;		$user = Model_UserTable::getInstance()-&amp;gt;find($id);&lt;br/&gt;
		$user-&amp;gt;refresh(true);&lt;br/&gt;
		assert($user-&amp;gt;City-&amp;gt;name == &apos;Mainz&apos;);	&lt;/p&gt;

&lt;p&gt;The last assert failse. I realized the problem while updating just a referenz using the fromArray() method like $user-&amp;gt;City-&amp;gt;fromArray(). The city would be saved correctly in DB but the foreign key in the user table would not be updated. After debugging I recognized that the $user is not replaced in UnitOfWork::saveGraph() because the $user is still in CLEAN state.&lt;/p&gt;

&lt;p&gt;Using &quot; $user-&amp;gt;coreSetRelated(&apos;Country&apos;, $user-&amp;gt;Country);&quot; or &quot;$user-&amp;gt;state(Doctrine_Record::STATE_DIRTY);&quot; after &quot;$user-&amp;gt;City-&amp;gt;name = &apos;Mainz&apos;&quot; would fix the prob in this case. As well as creating a new City instance an set $user-&amp;gt;City with this instance like:&lt;/p&gt;

&lt;p&gt;                $city = new Model_City();&lt;br/&gt;
                $city-&amp;gt;name = &apos;Mainz&apos;;&lt;br/&gt;
                $user-&amp;gt;City = $city;&lt;/p&gt;

&lt;p&gt;Also $user-&amp;gt;isModified(true) is true. So I fixed the issues in my case by changing the state of my records to DIRTY if the &quot;$this-&amp;gt;state() == CLEAN &amp;amp;&amp;amp; $user-&amp;gt;isModified(true) == true&quot; in the preSave() method of an abstract class that my Base classes are extending....&lt;/p&gt;</description>
                <environment>Ubuntu 9.04, PHP 5.2.6, MySQL 5.1, Zend Framework</environment>
            <key id="11363">DC-684</key>
            <summary>After adding a Reference, the ForeignKeys in the DB are not updatet</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="lk2.0">Lars Kosubek</reporter>
                        <labels>
                    </labels>
                <created>Fri, 14 May 2010 15:02:09 +0000</created>
                <updated>Tue, 26 Oct 2010 08:13:33 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Record</component>
                <component>Relations</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="14380" author="mars105" created="Wed, 15 Sep 2010 09:12:04 +0000"  >&lt;p&gt;Spend the last hour trying to get a workaround on this one.&lt;/p&gt;

&lt;p&gt;It apear to me that the solution is not easy. The object is modified while in STATE_LOCKED state, meaning that any state change in Record::_set() is not passed back to UnitOfWork::saveGraph() and therfor not saved in the database.&lt;/p&gt;

&lt;p&gt;Finaly I&apos;ve managed to make a realy dirty fix, I&apos;ll attach it if it come handy to somebody.&lt;br/&gt;
Keep in mind this is only a workaround and has NOT been tested. Use at your own risk...&lt;/p&gt;</comment>
                    <comment id="14381" author="mars105" created="Wed, 15 Sep 2010 09:13:00 +0000"  >&lt;p&gt;Dirty fix, see comments.&lt;br/&gt;
! NOT tested thoroughly !&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10797" name="DC_684_dirty_fix.patch" size="1490" author="mars105" created="Wed, 15 Sep 2010 09:13:00 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-649] Getting Doctrine_Validator_Exception on Doctrine_Record::replace() when using unique</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-649</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Using this code:&lt;/p&gt;

&lt;p&gt;$user = new User();&lt;br/&gt;
$user-&amp;gt;mail = &apos;mail@mail.mail&apos;;&lt;br/&gt;
$user-&amp;gt;save();&lt;br/&gt;
$user2 = new User();&lt;br/&gt;
$user2-&amp;gt;mail = &apos;mail@mail.mail&apos;;&lt;br/&gt;
$user2-&amp;gt;replace();&lt;/p&gt;

&lt;p&gt;I get the following exception:&lt;/p&gt;

&lt;p&gt;Fatal error: Uncaught exception &apos;Doctrine_Validator_Exception&apos; with message &apos;Validation failed in class User: 1 field had validation error: 1 validator failed on mail (unique)&apos; in D:\Workspace\Doctrine\Doctrine\Transaction.php:265&lt;br/&gt;
Stack trace:&lt;br/&gt;
#0 D:\Workspace\Doctrine\Doctrine\Connection.php(1395): Doctrine_Transaction-&amp;gt;commit(NULL)&lt;br/&gt;
#1 D:\Workspace\Doctrine\Doctrine\Connection\UnitOfWork.php(143): Doctrine_Connection-&amp;gt;commit()&lt;br/&gt;
#2 D:\Workspace\Doctrine\Doctrine\Record.php(1748): Doctrine_Connection_UnitOfWork-&amp;gt;saveGraph(Object(User), true)&lt;br/&gt;
#3 D:\Workspace\test.php: Doctrine_Record-&amp;gt;replace()&lt;br/&gt;
#4 &lt;/p&gt;
{main}
&lt;p&gt;thrown in D:\Workspace\Doctrine\Doctrine\Transaction.php on line 265&lt;/p&gt;</description>
                <environment>PHP 5.3.2, MySQL 5.1.46</environment>
            <key id="11268">DC-649</key>
            <summary>Getting Doctrine_Validator_Exception on Doctrine_Record::replace() when using unique</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="p4lschool">p4l</reporter>
                        <labels>
                    </labels>
                <created>Mon, 26 Apr 2010 11:41:15 +0000</created>
                <updated>Mon, 26 Apr 2010 11:41:15 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-635] synchronizeWithArray and link-table</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-635</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Tree tables : tags, compo_show_tag, shows&lt;/p&gt;

&lt;p&gt;&quot;compo_show_tag&quot; make a link between tags and shows. It&apos;s a many-to-many relationship.&lt;/p&gt;

&lt;p&gt;Assume that all the Tags / Shows are already create. The max id is 300 for shows and tags.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$itemArray							= array ();&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;					= 38;&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;shows&amp;quot;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;		= 36;&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;shows&amp;quot;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;		= 200;&lt;/p&gt;

&lt;p&gt;$item = new Model_Tag ();&lt;br/&gt;
$item-&amp;gt;synchronizeWithArray($itemArray, true);&lt;/p&gt;

&lt;p&gt;echo $item-&amp;gt;shows&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;-&amp;gt;idShow; //Output : 36&lt;br/&gt;
echo $item-&amp;gt;shows&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;-&amp;gt;idShow; //Output : 200&lt;/p&gt;

&lt;p&gt;$item-&amp;gt;save ();&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Above create two entry into the compo_show_table. Because all element are existing.&lt;/p&gt;


&lt;blockquote&gt;
&lt;p&gt;$itemArray							= array ();&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;					= 38;&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;shows&amp;quot;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;		= 36;&lt;/p&gt;

&lt;p&gt;$item = new Model_Tag ();&lt;br/&gt;
$item-&amp;gt;synchronizeWithArray($itemArray, true);&lt;/p&gt;

&lt;p&gt;echo $item-&amp;gt;shows&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;-&amp;gt;idShow; //Output : 36&lt;/p&gt;

&lt;p&gt;$item-&amp;gt;save ();&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Above remove the relation between Show#200 and Tag#38, but keep the relation between Show#36 and Tag#38.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$itemArray							= array ();&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;					= 38;&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;shows&amp;quot;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;		= 36;&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;shows&amp;quot;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;		= 150;&lt;br/&gt;
$item = new Model_Tag ();&lt;br/&gt;
$item-&amp;gt;synchronizeWithArray($itemArray, true);&lt;/p&gt;

&lt;p&gt;echo $item-&amp;gt;shows&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;-&amp;gt;idShow; //Output : 36&lt;br/&gt;
echo $item-&amp;gt;shows&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;-&amp;gt;idShow; //Output : 150&lt;/p&gt;

&lt;p&gt;$item-&amp;gt;save ();&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Above create a new relation, like the first example.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$itemArray							= array ();&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;					= 38;&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;shows&amp;quot;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;		= 36;&lt;br/&gt;
$itemArray&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;shows&amp;quot;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_identifier&amp;quot;&amp;#93;&lt;/span&gt;		= 140;&lt;/p&gt;

&lt;p&gt;$item = new Model_Tag ();&lt;br/&gt;
$item-&amp;gt;synchronizeWithArray($itemArray, true);&lt;/p&gt;

&lt;p&gt;echo $item-&amp;gt;shows&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;-&amp;gt;idShow; //Output : 36&lt;br/&gt;
echo $item-&amp;gt;shows&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;-&amp;gt;idShow; //Output : 140&lt;/p&gt;

&lt;p&gt;$item-&amp;gt;save ();&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Bug is above.&lt;br/&gt;
We except that Doctrine remove the relation between Show#150 and Tag#38 and add a new one between Show#140 and Tag#38. &lt;br/&gt;
Here the bug because Doctrine doesn&apos;t change anything. &lt;/p&gt;

&lt;p&gt;Thanks.&lt;br/&gt;
Armetiz.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11231">DC-635</key>
            <summary>synchronizeWithArray and link-table</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="armetiz">Thomas Tourlourat - Armetiz</reporter>
                        <labels>
                    </labels>
                <created>Fri, 16 Apr 2010 09:04:56 +0000</created>
                <updated>Fri, 16 Apr 2010 09:07:30 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-619] preHydrate/postHydrate events do not use proper sub-class component</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-619</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I am trying to use preHydrate/postHydrate with my models that use inheritance. The problem is that when using the parent table is used to query the records, the preHydrate/postHydrate events are passed to the parent record class instead of the proper sub-class for the current record.&lt;/p&gt;

&lt;p&gt;Using the example schema below, if I do a findAll() on the Person table and it contained two Student records and one Professor record... preHydrate would get called on Person instead of Student and Professor. This also applies for any listeners that are registered on Student/Professor and not Person.&lt;/p&gt;

&lt;p&gt;Person:&lt;br/&gt;
  columns:&lt;br/&gt;
    name: &lt;/p&gt;
{ type: string(50) }

&lt;p&gt;Student:&lt;br/&gt;
  inheritance:&lt;br/&gt;
    extends: Person&lt;br/&gt;
    type: column_aggregation&lt;br/&gt;
    keyField: type&lt;br/&gt;
    keyType: 1&lt;/p&gt;

&lt;p&gt;Professor:&lt;br/&gt;
  inheritance:&lt;br/&gt;
    extends: Person&lt;br/&gt;
    type: column_aggregation&lt;br/&gt;
    keyField: type&lt;br/&gt;
    keyValue: 2&lt;/p&gt;
</description>
                <environment>PHP 5.2.11 (cli), Doctrine 1.2 (Revision: 7537)</environment>
            <key id="11179">DC-619</key>
            <summary>preHydrate/postHydrate events do not use proper sub-class component</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mlehner">Matt Lehner</reporter>
                        <labels>
                    </labels>
                <created>Tue, 6 Apr 2010 14:55:23 +0000</created>
                <updated>Mon, 14 Jun 2010 09:28:51 +0000</updated>
                                    <version>1.2.0</version>
                <version>1.2.1</version>
                <version>1.2.2</version>
                                                <component>Inheritance</component>
                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-589] refreshRelated() causes an id to be changed from string to int, causing an unnecessary update query.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-589</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Here is 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;class Article &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;title&apos;, &apos;string&apos;, 255);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;body&apos;, &apos;string&apos;, 4096);
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasMany(&apos;Comment as Comments&apos;, array(
            &apos;local&apos; =&amp;gt; &apos;id&apos;,
            &apos;foreign&apos; =&amp;gt; &apos;articleId&apos;,
        ));
    }
}

class Comment &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_Record
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setTableDefinition()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;comment&apos;, &apos;string&apos;, 4096);
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;articleId&apos;, &apos;integer&apos;);
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasOne(&apos;Article&apos;, array(
            &apos;local&apos; =&amp;gt; &apos;articleId&apos;,
            &apos;foreign&apos; =&amp;gt; &apos;id&apos;,
        ));
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function preUpdate($e)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Exception(&apos;should not get here&apos;);
    }

}

$a = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Article();
$a-&amp;gt;title = &apos;Hi&apos;;
$a-&amp;gt;body = &apos;There&apos;;
$a-&amp;gt;save();

$c = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Comment();
$c-&amp;gt;comment = &apos;1st comment&apos;;
$c-&amp;gt;articleId = $a-&amp;gt;id;
$c-&amp;gt;save();

$a-&amp;gt;refreshRelated(&apos;Comments&apos;);

$a-&amp;gt;title = &apos;Hello&apos;;
$a-&amp;gt;save();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;What happens above is that the call to refreshRelated() causes the &apos;id&apos; of the comment to change from string:1 to int:1, which causes the last save of the article to try to save the comment. The exception is there just to illustrate that the Comment is being updated (which should not happen). For us - this is an issue not just because of the extra query, but because some entities in the system (like log entries) actually throw when updated.&lt;/p&gt;

&lt;p&gt;Tested against latest trunk.&lt;/p&gt;

&lt;p&gt;The issue seems to be introduced in r7361.&lt;/p&gt;</description>
                <environment>Ubuntu 9.10, PHP 5.2.10, pgsql 8.3</environment>
            <key id="11092">DC-589</key>
            <summary>refreshRelated() causes an id to be changed from string to int, causing an unnecessary update query.</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="vladev">Emil Vladev</reporter>
                        <labels>
                    </labels>
                <created>Fri, 19 Mar 2010 08:46:00 +0000</created>
                <updated>Mon, 29 Mar 2010 14:51:08 +0000</updated>
                                                                    <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="12504" author="jwage" created="Mon, 29 Mar 2010 14:51:08 +0000"  >&lt;p&gt;How does that revision cause the problem? it doesn&apos;t change any value that is referenced by the object itself. Are you sure the description of the problem is accurate? Maybe it would be best if I could run a Doctrine failing test case to see your problem.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-541] MSSQL Server: Enabling MARS prevents the saving of records.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-541</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;This is related to issue #540. In order to circumvent that issue, I enabled MARS (Multiple Active Result Sets) - now when attempting to save any record the following error results:&lt;/p&gt;

&lt;p&gt;Fatal error: Uncaught exception &apos;Doctrine_Transaction_Exception&apos; with message &apos;Rollback failed. There is no active transaction.&apos; in C:\www\doctrine\lib\Doctrine\Transaction.php on line 319&lt;/p&gt;

&lt;p&gt;This is actually caused by the following MSSQL error:&lt;/p&gt;

&lt;p&gt;exception &apos;Doctrine_Transaction_Exception&apos; with message &apos;SQLSTATE&lt;span class=&quot;error&quot;&gt;&amp;#91;42000&amp;#93;&lt;/span&gt;: Syntax error or access violation: 3997 &lt;span class=&quot;error&quot;&gt;&amp;#91;Microsoft&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;SQL Server Native Client 10.0&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;SQL Server&amp;#93;&lt;/span&gt;A transaction that was started in a MARS batch is still active at the end of the batch. The transaction is rolled back. (SQLExecDirect&lt;span class=&quot;error&quot;&gt;&amp;#91;3997&amp;#93;&lt;/span&gt; at ext\pdo_odbc\odbc_driver.c:247)&apos; in C:\www\doctrine\lib\Doctrine\Transaction.php:212 Stack trace: #0 C:\www\doctrine\lib\Doctrine\Transaction.php(511): Doctrine_Transaction-&amp;gt;beginTransaction(NULL) #1 C:\www\doctrine\lib\Doctrine\Connection.php(1377): Doctrine_Transaction-&amp;gt;beginInternalTransaction(NULL) #2 C:\www\doctrine\lib\Doctrine\Connection\UnitOfWork.php(64): Doctrine_Connection-&amp;gt;beginInternalTransaction() #3 C:\www\doctrine\lib\Doctrine\Record.php(1691): Doctrine_Connection_UnitOfWork-&amp;gt;saveGraph(Object(Model)) #4 C:\www\doctrine\tools\sandbox\index.php(83): Doctrine_Record-&amp;gt;save() #5 &lt;/p&gt;
{main}

&lt;p&gt;I haven&apos;t worked out what&apos;s going on yet, but this blog post may shed some light on it:&lt;br/&gt;
&lt;a href=&quot;http://blogs.msdn.com/cbiyikoglu/archive/2006/11/21/mars-transactions-and-sql-error-3997-3988-or-3983.aspx&quot; class=&quot;external-link&quot;&gt;http://blogs.msdn.com/cbiyikoglu/archive/2006/11/21/mars-transactions-and-sql-error-3997-3988-or-3983.aspx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I&apos;ve attached a script to reproduce this issue in the sandbox (MARS is enabled in the DSN).&lt;/p&gt;</description>
                <environment>PHP 5.3.1&lt;br/&gt;
MSSQL Server 2008&lt;br/&gt;
Windows&lt;br/&gt;
PHP PDO ODBC</environment>
            <key id="10990">DC-541</key>
            <summary>MSSQL Server: Enabling MARS prevents the saving of records.</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="craigmarvelley">Craig Marvelley</reporter>
                        <labels>
                    </labels>
                <created>Wed, 3 Mar 2010 13:20:00 +0000</created>
                <updated>Thu, 10 Jun 2010 04:40:57 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Connection</component>
                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="12237" author="jwage" created="Mon, 15 Mar 2010 16:23:31 +0000"  >&lt;p&gt;We&apos;ll need some more information. We don&apos;t have a way to test against mssql currently.&lt;/p&gt;</comment>
                    <comment id="12273" author="craigmarvelley" created="Tue, 16 Mar 2010 06:59:00 +0000"  >&lt;p&gt;I&apos;ve dug a little deeper and it seems that the exception is thrown because the Doctrine_Transaction_Mssql class has overrides for the transaction begin/commit/rollback methods. When I remove these overrides and let transactions be handled through the PDO API I don&apos;t get any exceptions while transactions seem to function as normal.&lt;/p&gt;

&lt;p&gt;Why are these methods overridden? Is it perhaps only necessary for the MSSQL PDO extension, as suggested here (&lt;a href=&quot;http://trac.symfony-project.org/wiki/HowToConnectToMSSQLServer&quot; class=&quot;external-link&quot;&gt;http://trac.symfony-project.org/wiki/HowToConnectToMSSQLServer&lt;/a&gt;), since that extension seemingly has no native transaction support (I&apos;ve never used it)? Perhaps this isn&apos;t necessary for the ODBC extension?&lt;/p&gt;</comment>
                    <comment id="12291" author="craigmarvelley" created="Tue, 16 Mar 2010 15:06:21 +0000"  >&lt;p&gt;This patch maintains the existing manual transaction functionality for MSSQL connections, but uses the native PDO API for ODBC connections.&lt;/p&gt;</comment>
                    <comment id="13188" author="jwage" created="Tue, 8 Jun 2010 14:32:50 +0000"  >&lt;p&gt;Hmm. I don&apos;t think this patch is good. It doesn&apos;t fix the problem, just hacks around it.&lt;/p&gt;</comment>
                    <comment id="13231" author="craigmarvelley" created="Tue, 8 Jun 2010 18:31:23 +0000"  >&lt;p&gt;Ok.. Do you have any recommendations for a better patch? While I agree my patch is far from elegant, it does at least allow MSSQL and ODBC to work alongside each other. As far as I can tell, the underlying issue is that Doctrine uses the same driver for two very different PDO extensions - I couldn&apos;t think of a way to resolve this issue without some kind of check as to which extension is in use.&lt;/p&gt;

&lt;p&gt;We could maybe catch the exception that&apos;s thrown in the first instance when running a manual query, and try calling the parent rollback method instead? Maybe only when the current connection is ODBC? That&apos;s essentially the same approach though, with the added overhead of an unnecessary query that we know will fail..&lt;/p&gt;

&lt;p&gt;I&apos;m very keen to find a fix that you&apos;re happy with for this since I&apos;ve been manually patching it for a while, so any feedback that would engender that would be great!&lt;/p&gt;</comment>
                    <comment id="13232" author="jwage" created="Tue, 8 Jun 2010 18:47:47 +0000"  >&lt;p&gt;I am still not sure of the exact problem/error that is happening. When isn&apos;t happening with the current code? or is something happening that should not?&lt;/p&gt;</comment>
                    <comment id="13248" author="craigmarvelley" created="Wed, 9 Jun 2010 06:58:08 +0000"  >&lt;p&gt;As far as I understand it (I&apos;m no SQL Server expert, unfortunately!) the issue is this: &lt;/p&gt;

&lt;p&gt;The Doctrine_Transaction_Mssql class is used for both the MSSQL and ODBC PDO extensions. It manages transactions by executing manual queries against the database (ROLLBACK TRANSACTION, COMMIT_TRANSACTION, etc.).&lt;/p&gt;

&lt;p&gt;This isn&apos;t compatible with the ODBC PDO extension and SQL Server when Multiple Active Record Sets is enabled; I believe MARS allows multiple transactions to co-exist, and this query-style way of managing them isn&apos;t compatible with that as transactions aren&apos;t &apos;namespaced&apos;. MARS is critical because without it there&apos;s no way of looping over more than one record set at the same time, something we take for granted in MySQL et al.&lt;/p&gt;

&lt;p&gt;From that link to the Symfony wiki I posted earlier, it appears that the query method of managing transactions is only necessary for the MSSQL PDO extension - quote:&lt;/p&gt;

&lt;p&gt;&quot;dblib doesn&apos;t support transactions so we need to add a workaround for transactions, last insert ID, and quoting&quot;&lt;/p&gt;

&lt;p&gt;This is backed up by the patch - when we let the ODBC driver handle transactions natively, everything works fine.&lt;/p&gt;

&lt;p&gt;Does that make sense?&lt;/p&gt;</comment>
                    <comment id="13250" author="jwage" created="Wed, 9 Jun 2010 12:39:06 +0000"  >&lt;p&gt;Now that I look at everything again, do we need to even be overriding those methods at all in Doctrine_Transaction_Mssql (_doRollback, _doCommit, _doBeginTransaction). We should just let the database driver handle it?&lt;/p&gt;</comment>
                    <comment id="13251" author="jwage" created="Wed, 9 Jun 2010 12:40:05 +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;
Index: lib/Doctrine/Transaction/Mssql.php
===================================================================
--- lib/Doctrine/Transaction/Mssql.php	(revision 7673)
+++ lib/Doctrine/Transaction/Mssql.php	(working copy)
@@ -65,28 +65,4 @@
 
         $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;execute($query);
     }
-    
-    /**
-     * Performs the rollback.
-     */
-    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; function _doRollback()
-    {
-        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;getDbh()-&amp;gt;exec(&apos;ROLLBACK TRANSACTION&apos;);
-    }
-    
-    /**
-     * Performs the commit.
-     */
-    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; function _doCommit()
-    {
-        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;getDbh()-&amp;gt;exec(&apos;COMMIT TRANSACTION&apos;);
-    }
-    
-    /**
-     * Begins a database transaction.
-     */
-    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; function _doBeginTransaction()
-    {
-        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;conn-&amp;gt;getDbh()-&amp;gt;exec(&apos;BEGIN TRANSACTION&apos;);
-    }
 }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It seems like we don&apos;t even need to do that?&lt;/p&gt;</comment>
                    <comment id="13264" author="craigmarvelley" created="Thu, 10 Jun 2010 04:40:57 +0000"  >&lt;p&gt;For ODBC, we definitely don&apos;t. That link suggests the above approach caters to the MSSQL extension. I&apos;ve not tried that one because I&apos;m on Windows and as you probably know it&apos;s not recommended; I imagine I&apos;d have way too many other problems were I to try! I didn&apos;t want to break anything for anyone using the MSSQL driver though, which led to my awkward patch.&lt;/p&gt;

&lt;p&gt;From my point of view, I&apos;d imagine the majority of people using SQL Server will be using a Windows stack, and therefore ODBC (and possibly the new SQL Server Driver for PHP PDO extension, which definitely won&apos;t need manual queries, in future) - so I&apos;d favour an approach that didn&apos;t compromise those drivers.&lt;/p&gt;

&lt;p&gt;As an aside - are there any plans afoot to support the new Microsoft endorsed driver? I imagine if you guys were to do so it would be for Doctrine 2, but do you know of any community effort to get it working in 1.2?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10422" name="index.php" size="1008" author="craigmarvelley" created="Wed, 3 Mar 2010 13:20:00 +0000" />
                    <attachment id="10484" name="mssql_transaction.patch" size="1585" author="craigmarvelley" created="Tue, 16 Mar 2010 15:06:21 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-478] Having a default value in a decimal field in base class forces Doctrine to try to save an instance even if not required.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-478</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have 2 classes. Order and Branch. An Order class can have one or no branch assigned to it. My base class definition for a branch is simple. It just has a name. &lt;/p&gt;

&lt;p&gt;The Order class has:&lt;br/&gt;
$this-&amp;gt;hasColumn(&apos;branchId&apos;, &apos;integer&apos;);&lt;/p&gt;

&lt;p&gt;and &lt;/p&gt;

&lt;p&gt;$this-&amp;gt;hasOne(&lt;br/&gt;
            &apos;Fds_Model_Branch as branch&apos;, &lt;br/&gt;
            array(&lt;br/&gt;
                &apos;local&apos; =&amp;gt; &apos;branchId&apos;,&lt;br/&gt;
                &apos;foreign&apos; =&amp;gt; &apos;id&apos;,&lt;br/&gt;
            )&lt;br/&gt;
        );&lt;/p&gt;

&lt;p&gt;The branch class had this:&lt;/p&gt;

&lt;p&gt;$this-&amp;gt;hasColumn(&apos;name&apos;, &apos;string&apos;, 50, array(&lt;br/&gt;
            &apos;notnull&apos; =&amp;gt; true,&lt;br/&gt;
            &apos;notblank&apos; =&amp;gt; true,&lt;br/&gt;
        ));&lt;/p&gt;

&lt;p&gt;No hasMany relation back to Orders.&lt;/p&gt;

&lt;p&gt;Using this setup, all my tests work.&lt;/p&gt;

&lt;p&gt;I added this to the Branch class.&lt;br/&gt;
$this-&amp;gt;hasColumn(&lt;br/&gt;
            &apos;localTax&apos;, &apos;decimal&apos;, null, &lt;br/&gt;
            array(&lt;br/&gt;
                &apos;notnull&apos; =&amp;gt; true,&lt;br/&gt;
                &apos;default&apos; =&amp;gt; 0,&lt;br/&gt;
            )&lt;br/&gt;
        );&lt;/p&gt;

&lt;p&gt;Now my tests fail with a validator error from the branch class for the name property whenever I try to save an order that has no branch associated to it. Pretty weird right? I mean, my order has no branch, and yet Doctrine tries to save one.&lt;/p&gt;

&lt;p&gt;But if I change the definition of localTax to this:&lt;br/&gt;
$this-&amp;gt;hasColumn(&apos;localTax&apos;, &apos;decimal&apos;);&lt;/p&gt;

&lt;p&gt;Then my tests work as expected again. Problem is, I need to assign the default value of 0 to localTax instead of null. &lt;/p&gt;

&lt;p&gt;Is this a bug?&lt;/p&gt;</description>
                <environment>Linux, PHP 5.3</environment>
            <key id="10834">DC-478</key>
            <summary>Having a default value in a decimal field in base class forces Doctrine to try to save an instance even if not required.</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="bzarzuela">Bryan Zarzuela</reporter>
                        <labels>
                    </labels>
                <created>Thu, 4 Feb 2010 09:49:13 +0000</created>
                <updated>Thu, 4 Feb 2010 09:49:13 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-476] PHP&apos;s is_subclass_of function causing failure in some contexts</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-476</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have a suspicion that this is related to issue: &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-386&quot; title=&quot;Doctrine_Hydrator_ArrayDriver may segfault Php when loaded by Zend Framework Autoloader&quot;&gt;DC-386&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The bug manifested its-self  by bailing with no php error output when calling Doctrine_Pager::execute() in php 5.2.10 (5.3 appears to work - Mac OS X while 5.2.10 fail on ubuntu and centos).&lt;/p&gt;

&lt;p&gt;I traced this down to Doctrine_Record::processPendingFields(), the offending line number is #477.&lt;/p&gt;

&lt;p&gt;Interestingly, if I call is_subclass_of() with exactly the same params in my view just prior to calling Doctrine_Pager::execute()  in my code, the error does not present its-self , i.e. I&apos;b adding the following code :&lt;/p&gt;

&lt;p&gt;is_subclass_of(&apos;Doctrine_Hydrator_RecordDriver&apos;, &apos;Doctrine_Hydrator_Graph&apos;);&lt;/p&gt;

&lt;p&gt;It can also be avoided by calling Doctrine_Pager::getQuery()-&amp;gt;getQuerySql(); and no doubt other code paths which change the environment in some way.&lt;/p&gt;
</description>
                <environment>php 5.2.10 on both CentOS 5.4 and Ubuntu 9.10</environment>
            <key id="10828">DC-476</key>
            <summary>PHP&apos;s is_subclass_of function causing failure in some contexts</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="pchapman">Peter Chapman</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Feb 2010 16:18:24 +0000</created>
                <updated>Fri, 30 Apr 2010 11:04:48 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-835] Inconsistent record validation on a notnull foreign key when the local relation is set</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-835</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Validator_ForeignKeys_TestCase#testForeignKeyIsValidIfLocalRelationIsSet()&lt;/p&gt;

&lt;p&gt;This test passes fine as is. But it fails if I make the following change:&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-none&quot;&gt;public function testForeignKeyIsValidIfLocalRelationIsSet()
{
    //$person = new TestPerson();
    $address = new TestAddress();
        
    //$address-&amp;gt;Person = $person;    
    $address-&amp;gt;Person-&amp;gt;first_name = &quot;John&quot;;
        
    $table = $address-&amp;gt;getTable();
    $errors = $table-&amp;gt;validateField(&apos;person_id&apos;, $address-&amp;gt;person_id, $address);
        
    $this-&amp;gt;assertEqual(0, $errors-&amp;gt;count());
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The only difference is that instead of explicitly assigning $address-&amp;gt;Person, I&apos;m letting it happen automatically when assigning the first name. What is it about the property chaining when creating the related record that screws up doctrine&apos;s internal reference tracking?&lt;/p&gt;</description>
                <environment></environment>
            <key id="11806">DC-835</key>
            <summary>Inconsistent record validation on a notnull foreign key when the local relation is set</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="adamthehutt">Adam Huttler</reporter>
                        <labels>
                    </labels>
                <created>Thu, 19 Aug 2010 22:33:14 +0000</created>
                <updated>Tue, 24 Aug 2010 22:14:20 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Record</component>
                <component>Relations</component>
                <component>Validators</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14019" author="adamthehutt" created="Thu, 19 Aug 2010 23:20:35 +0000"  >&lt;p&gt;This is an existing test case for which I&apos;ve added two tests. The first one fails, while the second passes. The first one captures the issue I&apos;m experiencing.&lt;/p&gt;</comment>
                    <comment id="14062" author="adamthehutt" created="Tue, 24 Aug 2010 22:14:20 +0000"  >&lt;p&gt;This patch augments the test file with the new test and also makes a change to Doctrine_Related_LocalKey that causes the test to pass.&lt;/p&gt;

&lt;p&gt;Unfortunately, it causes another test to fail: 1072.&lt;/p&gt;

&lt;p&gt;I don&apos;t fully understand test 1072, but it appears to be testing closely related behavior (i.e. relation chaining).&lt;/p&gt;

&lt;p&gt;What do you think?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10748" name="dc-835-patch.txt" size="1601" author="adamthehutt" created="Tue, 24 Aug 2010 22:14:20 +0000" />
                    <attachment id="10746" name="ForeignKeysTestCase.php" size="2549" author="adamthehutt" created="Thu, 19 Aug 2010 23:20:35 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-814] protected method _isValueModified returns wrong result</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-814</link>
                <project id="10031" key="DC">Doctrine 1</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-keyword&quot;&gt;protected&lt;/span&gt; function _isValueModified($type, $old, $&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt;)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;instanceof&lt;/span&gt; Doctrine_Expression) {
            &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;if&lt;/span&gt; ($type == &apos;&lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;&apos; &amp;amp;&amp;amp; (is_bool($old) || is_numeric($old)) &amp;amp;&amp;amp; (is_bool($&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt;) || is_numeric($&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt;)) &amp;amp;&amp;amp; $old == $&lt;span class=&quot;code-keyword&quot;&gt;new&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;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (in_array($type, array(&apos;decimal&apos;, &apos;&lt;span class=&quot;code-object&quot;&gt;float&lt;/span&gt;&apos;)) &amp;amp;&amp;amp; is_numeric($old) &amp;amp;&amp;amp; is_numeric($&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt;)) {
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $old * 100 != $&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; * 100;
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (in_array($type, array(&apos;integer&apos;, &apos;&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;&apos;)) &amp;amp;&amp;amp; is_numeric($old) &amp;amp;&amp;amp; is_numeric($&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt;)) {
            &lt;span class=&quot;code-comment&quot;&gt;// getType($old) in many cases is always &apos;string&apos; so using &lt;span class=&quot;code-keyword&quot;&gt;operator&lt;/span&gt; &apos;!==&apos;  is make no sense 
&lt;/span&gt;            &lt;span class=&quot;code-comment&quot;&gt;// the only needed condition is already checked: i mean &apos;is_numeric&apos;
&lt;/span&gt;            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $old !== $&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt;;
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($type == &apos;timestamp&apos; || $type == &apos;date&apos;) {
            $oldStrToTime = strtotime($old);
            $newStrToTime = strtotime($&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt;);
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ($oldStrToTime &amp;amp;&amp;amp; $newStrToTime) {
                &lt;span class=&quot;code-comment&quot;&gt;// the same here: it&apos;s make no sense to using &apos;!==&apos; - first and second variable are the same type 
&lt;/span&gt;                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $oldStrToTime !== $newStrToTime;
            } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $old !== $&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt;;
            }
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
            &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $old !== $&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt;;
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>Apache/2.2.15 (Win64) PHP/5.3.2 </environment>
            <key id="11747">DC-814</key>
            <summary>protected method _isValueModified returns wrong result</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mstrzele">Micha&#322; Strzelecki</reporter>
                        <labels>
                    </labels>
                <created>Tue, 10 Aug 2010 06:36:32 +0000</created>
                <updated>Tue, 10 Aug 2010 06:58:58 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13891" author="mstrzele" created="Tue, 10 Aug 2010 06:40:00 +0000"  >&lt;p&gt;Using operator &apos;!==&apos; is make no sense. The result is wrong after that comparition.&lt;br/&gt;
The implication of that is wrong state of the record if it is id of relation hydrate after joins.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-810] Doctrine relations: Doctrine_Record::fromArray() does not update local field when new linked record is created</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-810</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Doctrine_Record::fromArray() does not update local field when new linked record is created.&lt;/p&gt;

&lt;p&gt;Case:&lt;/p&gt;

&lt;p&gt;1. I have a model1 with a hasOne relation to model2.&lt;/p&gt;

&lt;p&gt;2. I have a record in model1 with no model2 related&lt;/p&gt;

&lt;p&gt;3. Then i try to update model1 adding a new related model2 record using Doctrine_Record::fromArray(), model2 is created (Doctrine_Record::toArray() shows me the new row in model2, created and linked to model1)&lt;/p&gt;

&lt;p&gt;4. When I save and refresh model1, relation disappear (local field on model1 who links to model2 is empty).&lt;/p&gt;

&lt;p&gt;So it seems that Doctrine_Record::fromArray() doesn&apos;t recognize the change on model1 if I link it to a new foreign record. In fact if I modify some other field in model1, create and link a new model2 record, all works good!&lt;/p&gt;

&lt;p&gt;Digging in Record.php I found a trick, Doctrine_Record::fromArray() doesn&apos;t update the state of the model when relations are touched, so I force record state to Doctrine_Record::STATE_DIRTY.&lt;/p&gt;

&lt;p&gt;Diff file is attached, but it&apos;s still a workaround.&lt;/p&gt;</description>
                <environment>$uname -a&lt;br/&gt;
Linux debianVM 2.6.30-2-686 #1 SMP Sat Sep 26 01:16:22 UTC 2009 i686 GNU/Linux&lt;br/&gt;
&lt;br/&gt;
$php -v&lt;br/&gt;
PHP 5.2.11-1 with Suhosin-Patch 0.9.7 (cli) (built: Sep 20 2009 12:28:20)&lt;br/&gt;
Copyright (c) 1997-2009 The PHP Group&lt;br/&gt;
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;with Xdebug v2.0.3, Copyright (c) 2002-2007, by Derick Rethans&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;with Suhosin v0.9.29, Copyright (c) 2007, by SektionEins GmbH&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
</environment>
            <key id="11729">DC-810</key>
            <summary>Doctrine relations: Doctrine_Record::fromArray() does not update local field when new linked record is created</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="agopaul">Paolo Agostinetto</reporter>
                        <labels>
                    </labels>
                <created>Fri, 6 Aug 2010 06:00:47 +0000</created>
                <updated>Fri, 6 Aug 2010 06:00:47 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10722" name="doctrine1_bug.diff" size="495" author="agopaul" created="Fri, 6 Aug 2010 06:00:47 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-797] Records containing a one-to-one relation are hydrated as dirty/modified</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-797</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Attached is a self-contained 80 line test. In the test, Foo has an one to one relation to Bar. There is a null value in the foreign key column (at least one Foo without a Bar). And the relation is being used via this DQL:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Doctrine_Query::create()&amp;#45;&amp;gt;from(&apos;Foo f&apos;)&amp;#45;&amp;gt;leftJoin(&apos;f.Bar b&apos;)-&amp;gt;execute();&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;At around line 254 of Doctrine_Hydrator_Graph/Graph.php, the hydrator sets the value of the relation column to Doctrine_Null if there is no related record:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;$prev&lt;span class=&quot;error&quot;&gt;&amp;#91;$parent&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;$relationAlias&amp;#93;&lt;/span&gt; = $this-&amp;gt;getNullPointer();&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;This causes Doctrine_Record to check if the value of the foreign key field was updated, which it does by calling Doctrine_Record::_isValueModified(). However, that method considers an update from null to Doctrine_Null as a modification. So, the record (and eventually the entire Collection returned) is marked as Doctrine_Record::STATE_DIRTY, even though it contains no modifications. This occurs during hydration, so the caller never sees the record as being clean.&lt;/p&gt;

&lt;p&gt;The workaround I&apos;m using is to subclass Doctrine_Record, and return false from _isValueModified() when moving from null to Doctrine_Null. But I think this could also be fixed in the hydrator.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11680">DC-797</key>
            <summary>Records containing a one-to-one relation are hydrated as dirty/modified</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="dominic.scheirlinck">Dominic Scheirlinck</reporter>
                        <labels>
                    </labels>
                <created>Mon, 26 Jul 2010 02:26:49 +0000</created>
                <updated>Wed, 6 Jul 2011 19:31:56 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Record</component>
                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14403" author="dominic.scheirlinck" created="Wed, 15 Sep 2010 21:39:12 +0000"  >&lt;p&gt;Patch is here: &lt;a href=&quot;http://github.com/doctrine/doctrine1/pull/7&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine1/pull/7&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14576" author="dominic.scheirlinck" created="Sun, 17 Oct 2010 17:25:36 +0000"  >&lt;p&gt;New pull request, done on a topic branch this time (and rebased to be much nicer)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/doctrine/doctrine1/pull/8&quot; class=&quot;external-link&quot;&gt;http://github.com/doctrine/doctrine1/pull/8&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="16122" author="derek" created="Wed, 6 Jul 2011 19:16:40 +0000"  >&lt;p&gt;Record.php.diff contains basically the patch Dominic attached but also makes sure that the internal property value is set regardless of whether the record is marked as dirty or not.  Some code will break when the internal property value is left &amp;lt;unset&amp;gt; instead of Doctrine_Null.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11025" name="Record.php.diff" size="1762" author="derek" created="Wed, 6 Jul 2011 19:16:40 +0000" />
                    <attachment id="10708" name="test.php" size="1829" author="dominic.scheirlinck" created="Mon, 26 Jul 2010 02:26:49 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-774] Cannot fromArray a toArray with many to many records</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-774</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When working with a many to many record, if you &lt;tt&gt;toArray&lt;/tt&gt; then &lt;tt&gt;synchronizeWithArray&lt;/tt&gt;/&lt;tt&gt;fromArray&lt;/tt&gt; the result - you get an exception. &lt;/p&gt;

&lt;p&gt;This appears to be due to the fact that &lt;tt&gt;toArray&lt;/tt&gt; returns collections of &lt;tt&gt;array(0 =&amp;gt; false)&lt;/tt&gt; (because a record is in a locked state) and &lt;tt&gt;fromArray&lt;/tt&gt; will attempt to &lt;tt&gt;link()&lt;/tt&gt; the &lt;tt&gt;refClass&lt;/tt&gt; (which has multiple identifiers).&lt;/p&gt;

&lt;p&gt;Here&apos;s a test that should show this behavior: &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 Doctrine_Ticket_DC774_TestCase &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; Doctrine_UnitTestCase
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function prepareTables()
    {
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;tables[] = &apos;EntityAddress&apos;;
        $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;tables[] = &apos;Book&apos;;
        parent::prepareTables();
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function prepareData()
    {
        $user = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; User();
        $user-&amp;gt;name = &apos;TestUser&apos;;

        $address = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Address();
        $address-&amp;gt;address = &apos;TestAddress&apos;;

        $user-&amp;gt;Addresses[] = $address;
        
        $user-&amp;gt;save();
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testToArraySynchronizeWithManyToMany() {
        $user = Doctrine_Core::getTable(&apos;User&apos;)-&amp;gt;findOneByName(&apos;TestUser&apos;);
        $user-&amp;gt;refreshRelated();
        $user-&amp;gt;synchronizeWithArray($user-&amp;gt;toArray());
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function testToArrayFromManyToMany() {
        $user = Doctrine_Core::getTable(&apos;User&apos;)-&amp;gt;findOneByName(&apos;TestUser&apos;);
        $user-&amp;gt;refreshRelated();
        $user-&amp;gt;fromArray($user-&amp;gt;toArray());
    }
}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="11578">DC-774</key>
            <summary>Cannot fromArray a toArray with many to many records</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jochu">Jeff Chu</reporter>
                        <labels>
                    </labels>
                <created>Thu, 1 Jul 2010 19:00:14 +0000</created>
                <updated>Thu, 1 Jul 2010 20:04:35 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Record</component>
                <component>Relations</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="13493" author="jochu" created="Thu, 1 Jul 2010 19:42:18 +0000"  >&lt;p&gt;I doubt this is the right way to fix this, but we wrote in a patch that has the link() function ignore relations that with multiple identifiers. I figured this would be alright since linking those in directly don&apos;t make too much sense anyways.&lt;/p&gt;

&lt;p&gt;It seems to pass the doctrine test suite. I&apos;ve attached the patch in case anyone is curious. &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10687" name="doctrine-link.patch" size="1478" author="jochu" created="Thu, 1 Jul 2010 19:42:18 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-704] Where fields not escaped properly when deleting associations.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-704</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;We noticed that in both Doctrine/Record.php and Doctrine/Connection/UnitOfWork.php the fields in the where clause arent being escaped properly. A few of our fields happen to be keywords, but it seems that these queries arent escaping the names of fields that happen to be keywords.&lt;/p&gt;

&lt;p&gt;I have verified the field name is in the keywords list for my driver.&lt;/p&gt;

&lt;p&gt;This happens near the following code:&lt;br/&gt;
Doctrine/Record.php:2465&lt;br/&gt;
Doctrine/Record.php:2476&lt;br/&gt;
Doctrine/Connection/UnitOfWork.php: 443&lt;/p&gt;</description>
                <environment>Debian 5, PHP 5.3, Symfony 1.4.4, sfDoctrinePlugin, Pgsql driver</environment>
            <key id="11414">DC-704</key>
            <summary>Where fields not escaped properly when deleting associations.</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="grmartin">Glenn R. Martin</reporter>
                        <labels>
                    </labels>
                <created>Tue, 25 May 2010 12:33:50 +0000</created>
                <updated>Mon, 14 Jun 2010 08:26:40 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="13149" author="jwage" created="Tue, 8 Jun 2010 10:19:55 +0000"  >&lt;p&gt;Can you provide a patch with the changes?&lt;/p&gt;</comment>
                    <comment id="13306" author="grmartin" created="Mon, 14 Jun 2010 08:26:40 +0000"  >&lt;p&gt;The following is the patch you requested. This is what &lt;b&gt;WE&lt;/b&gt; did for our specific case to fix this... though it wont work with any other driver... What we really should have done (if I had been given time) was to pull the escape characters from the database driver so this would work on every database, not just Postgres.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10645" name="diff.patch" size="3009" author="grmartin" created="Mon, 14 Jun 2010 08:26:40 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-852] CLONE -Fix returned type value : SQL integers to PHP integers when getting a value from the database.</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-852</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Hi Jon,&lt;/p&gt;

&lt;p&gt;I have a request for you to improve Doctrine. When declaring a column as an integer, it seems that Doctrine returns a string when getting the value of that column. For example, if I have a &quot;status&quot; column, which can take 0, 1 or 2 as its value, Doctrine will return these values as string, which is not really logical and returning the good PHP type is the goal of an ORM. I&apos;m fond of the triple equal symbol to test a value and I did not understand why this did not work at start :&lt;/p&gt;

&lt;p&gt;// in my myModel class&lt;br/&gt;
class myModel extends Doctrine_Record&lt;br/&gt;
{&lt;br/&gt;
  const STATUS_VALIDATED = 1;&lt;/p&gt;

&lt;p&gt;  public function isValidated()&lt;/p&gt;
  {
    return self::STATUS_VALIDATED === $this-&amp;gt;getStatus();
  }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;That&apos;s why getStatus() gives me a string instead of an integer, whereas the column is declared as an integer in my schema. I&apos;m forced to cast myself the returned value of getStatus() in my model.&lt;/p&gt;</description>
                <environment></environment>
            <key id="11863">DC-852</key>
            <summary>CLONE -Fix returned type value : SQL integers to PHP integers when getting a value from the database.</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="enrico">Enrico Stahn</reporter>
                        <labels>
                    </labels>
                <created>Wed, 1 Sep 2010 08:19:12 +0000</created>
                <updated>Thu, 2 Sep 2010 08:11:23 +0000</updated>
                                    <version>1.2.3</version>
                                <fixVersion>1.2.4</fixVersion>
                                <component>Attributes</component>
                <component>Data Fixtures</component>
                <component>Native SQL</component>
                <component>Query</component>
                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="14214" author="enrico" created="Wed, 1 Sep 2010 11:38:05 +0000"  >&lt;p&gt;Proposal for a solution: &lt;a href=&quot;http://github.com/estahn/doctrine1/compare/master...DC-852&quot; class=&quot;external-link&quot;&gt;http://github.com/estahn/doctrine1/compare/master...DC-852&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="14225" author="jwage" created="Wed, 1 Sep 2010 14:46:04 +0000"  >&lt;p&gt;So if you enable this attribute you live with the fact that casting a string to an integer that is longer than php max integer will give weird results?&lt;/p&gt;</comment>
                    <comment id="14235" author="enrico" created="Thu, 2 Sep 2010 08:11:23 +0000"  >&lt;p&gt;i&apos;m far from happy with this solution. if an integer that is greater than php max int gets casted it will be casted into a value of type double. if you enable that attribute only values that could successfully casted into an integer will be casted otherwise an exception will be thrown.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1018] Circular references to named entities break during data importing</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1018</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;If the schema specifies that records relate to each other in both directions:&lt;/p&gt;

&lt;p&gt;{{&lt;br/&gt;
Kitten:&lt;br/&gt;
 columns:&lt;br/&gt;
   basket_id: integer&lt;br/&gt;
 relations:&lt;br/&gt;
  Basket:&lt;br/&gt;
   local: basket_id&lt;/p&gt;

&lt;p&gt;Basket:&lt;br/&gt;
  columns:&lt;br/&gt;
   fluffiest_kitten_id: integer&lt;br/&gt;
  relaitons:&lt;br/&gt;
   FluffiestKitten:&lt;br/&gt;
    type: one&lt;br/&gt;
    class: Kitten&lt;br/&gt;
    local: fluffiest_kitten_id&lt;br/&gt;
}}&lt;/p&gt;

&lt;p&gt;Then a data dump for such a schema won&apos;t properly load one of the keys, e.g:&lt;/p&gt;

&lt;p&gt;{{&lt;br/&gt;
Kitten:&lt;br/&gt;
 Kitten1:&lt;br/&gt;
  Basket: Basket1&lt;/p&gt;

&lt;p&gt;Basket:&lt;br/&gt;
 Basket1:&lt;br/&gt;
  FluffiestKitten: Kitten1&lt;br/&gt;
}}&lt;/p&gt;

&lt;p&gt;Will result in either fluffiest_kitten_id or basket_id being set to 0&lt;/p&gt;

&lt;p&gt;See also ticket &lt;a href=&quot;http://www.doctrine-project.org/jira/browse/DC-555&quot; title=&quot;infinite recursion happens when saving models with circular reference&quot;&gt;&lt;del&gt;DC-555&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="12826">DC-1018</key>
            <summary>Circular references to named entities break during data importing</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="mikeseth">Mike Seth</reporter>
                        <labels>
                    </labels>
                <created>Thu, 14 Jul 2011 10:59:18 +0000</created>
                <updated>Thu, 14 Jul 2011 10:59:18 +0000</updated>
                                    <version>1.2.4</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-950] Doctrine_Record magic _set() doesn&apos;t validate field type for timestamp/datetime/etc..</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-950</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;So I ran into this recently. the magic _set() in Doctrine_Record doesn&apos;t check/validate the type of the field. The use case is when you you do something like:&lt;br/&gt;
setCreatedAt(time()); This will not work correctly with date/time or timestamp types in Doctrine, even though Propel handles this fine. Also MYSQL will not throw an error with default sql_mode and will put garbage data into the database.&lt;/p&gt;

&lt;p&gt;The only way to generate the right date/time value is to always format that string with the &quot;right&quot; format. This should be easier and can be easier if it supported either a timestamp (time() or a DateTime() object (just like Symfony plugin does for setDateTimeObject() function). This is just a few lines of code, let me know if I should attach a patch.&lt;/p&gt;

&lt;p&gt;I would love to see the Doctrine_Record implement this functionality. There&apos;s a ton of results on frustrated users trying to figure out how to set the date/time values properly using Doctrine.&lt;/p&gt;</description>
                <environment></environment>
            <key id="12248">DC-950</key>
            <summary>Doctrine_Record magic _set() doesn&apos;t validate field type for timestamp/datetime/etc..</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gena01">Gennady Feldman</reporter>
                        <labels>
                    </labels>
                <created>Thu, 23 Dec 2010 20:38:39 +0000</created>
                <updated>Mon, 24 Jan 2011 11:36:01 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15180" author="gena01" created="Mon, 24 Jan 2011 11:34:17 +0000"  >&lt;p&gt;Symfony actually added a work around by writing another function &quot;setDateTimeObject()&quot; to set these fields in a more friendly way. Ideally I would love to see support for time() and date_create() natively in Doctrine.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-1044] record Line 2430 Unlink method Warning: Illegal offset type in sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php on line 2459</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1044</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When you have a new unpersisted object and you call a method to a referenced object - when calling the unlink() method on referenced object the above error is called.&lt;/p&gt;

&lt;p&gt;Warning: Illegal offset type in sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php on line 2459 &lt;/p&gt;

&lt;p&gt;eg&lt;/p&gt;

&lt;p&gt;$foo = new foo();&lt;/p&gt;

&lt;p&gt;$foo-&amp;gt;getBar(); This call will bind a reference of Bar against the foo object.&lt;/p&gt;

&lt;p&gt;$foo-&amp;gt;unlink(&apos;bar&apos;);&lt;/p&gt;

&lt;p&gt;As no objects are yet persisted, the unlink method tries to match ids on the objects that do not exist.&lt;/p&gt;</description>
                <environment></environment>
            <key id="13239">DC-1044</key>
            <summary>record Line 2430 Unlink method Warning: Illegal offset type in sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php on line 2459</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="kylerclarke">Kyle Clarke</reporter>
                        <labels>
                    </labels>
                <created>Mon, 5 Dec 2011 00:01:28 +0000</created>
                <updated>Mon, 5 Dec 2011 00:01:28 +0000</updated>
                                    <version>1.2.3</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>1</votes>
                        <watches>1</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-418] Inherited models creating NOT NULL restrictions on their parents</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-418</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;to reproduce, create the yaml included in sample.yaml (Note the not-null columns in each subclass)&lt;/p&gt;

&lt;p&gt;if you try to save an OnlineProduct without setting copyright_year, or if you create a print_product without setting website_branding_id, then you will get a not null error.&lt;br/&gt;
Inherited tables should be able to set their own NOT NULL columns without affecting other tables in the inheritance tree (should be handled in the preSave() method? or is there another mechanism?)&lt;/p&gt;</description>
                <environment>Linux skywalker-9 2.6.31-17-generic #54-Ubuntu SMP Thu Dec 10 17:01:44 UTC 2009 x86_64 GNU/Linux&lt;br/&gt;
</environment>
            <key id="10713">DC-418</key>
            <summary>Inherited models creating NOT NULL restrictions on their parents</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="jlukescott">luke scott</reporter>
                        <labels>
                    </labels>
                <created>Mon, 11 Jan 2010 18:17:58 +0000</created>
                <updated>Mon, 11 Jan 2010 18:19:57 +0000</updated>
                                    <version>1.2.1</version>
                                                <component>Attributes</component>
                <component>Inheritance</component>
                <component>Record</component>
                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="11365" author="jlukescott" created="Mon, 11 Jan 2010 18:19:57 +0000"  >&lt;p&gt;YAML format was destroyed during copy &amp;amp; paste!&lt;br/&gt;
I&apos;m attaching the sample yaml, instead of including it in the description&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10279" name="sample.yaml" size="911" author="jlukescott" created="Mon, 11 Jan 2010 18:19:57 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-686] postHydrate listener isn&apos;t called for related records</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-686</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I have model A which has a one-to-one relationship with model B. They both have a listener on them which does an action on postHydrate. When I load model A, the postHydrate is called successfully. However when I then load the related model B (via $oMyModelA-&amp;gt;B; or whatever), the listener is not called. This is the same when using the hook on the model - A::postHydrate() is called but B::postHydrate() is not.&lt;/p&gt;

&lt;p&gt;Unit test demonstrating this bug is attached.&lt;/p&gt;</description>
                <environment>Debian</environment>
            <key id="11377">DC-686</key>
            <summary>postHydrate listener isn&apos;t called for related records</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="ondistantshores">Cameron Ross</reporter>
                        <labels>
                    </labels>
                <created>Mon, 17 May 2010 03:28:43 +0000</created>
                <updated>Sun, 5 Sep 2010 12:22:28 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="14278" author="ben.davies" created="Sun, 5 Sep 2010 12:22:28 +0000"  >&lt;p&gt;This is invalid.&lt;br/&gt;
In the 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;$r-&amp;gt;Related-&amp;gt;save();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;doesn&apos;t create a blank record, thus there is never a relation to postHydrate&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10605" name="NewTestCase.php" size="3456" author="ondistantshores" created="Mon, 17 May 2010 03:28:43 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-642] import/export Array</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-642</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Retreive an object &quot;A&quot; and some related object from the database.&lt;br/&gt;
Export it into an array.&lt;br/&gt;
Create an other instance of &quot;A&quot; and import array from the previous exported array.&lt;br/&gt;
Just save the new instance.&lt;/p&gt;

&lt;p&gt;Doctrine re-create the object into DB. If you have some integrity constraint like primary key, you will see an SQL error.&lt;/p&gt;

&lt;p&gt;In the following example with &quot;video&quot; and &quot;tags&quot;, Doctrine want to re-create the video and tag objects.&lt;br/&gt;
The reason is that the exported array doesn&apos;t include the &quot;_identifier&quot; key.&lt;/p&gt;

&lt;p&gt;In my mind, the problem show and other problem, that we are force to use the &quot;identifier&quot; or assignIdentifier on the Model domain object to work with an existing object. &lt;br/&gt;
Doctrine know the Primary key of all the model domain objects. Why Doctrine doesn&apos;t use the assignIdentifier when the user change the PK of the Model domain object... In this case, assignIdentifier could be into a private scope.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$oVideo	= Doctrine_Query::create ()&lt;br/&gt;
    		-&amp;gt;select (&quot;video.&lt;b&gt;, tags.&lt;/b&gt;&quot;)&lt;br/&gt;
    		-&amp;gt;from (&quot;Model_Video video&quot;)&lt;br/&gt;
    		-&amp;gt;leftJoin (&quot;video.tags tags&quot;)&lt;br/&gt;
    		-&amp;gt;where (&quot;video.id_show = 500&quot;)&lt;br/&gt;
    		-&amp;gt;fetchOne ();&lt;br/&gt;
$oVideoArray	= $oVideo-&amp;gt;toArray();&lt;br/&gt;
$oVideo-&amp;gt;save ();&lt;/p&gt;

&lt;p&gt;$oVideoBis	= new Model_Video ();&lt;br/&gt;
$oVideoBis-&amp;gt;fromArray($oVideoArray, true);&lt;br/&gt;
$oVideoArrayBis	= $oVideo-&amp;gt;toArray();&lt;br/&gt;
$oVideoBis-&amp;gt;save ();&lt;/p&gt;&lt;/blockquote&gt;</description>
                <environment></environment>
            <key id="11256">DC-642</key>
            <summary>import/export Array</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="armetiz">Thomas Tourlourat - Armetiz</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Apr 2010 08:04:15 +0000</created>
                <updated>Thu, 22 Apr 2010 08:04:15 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>

<item>
            <title>[DC-776] $record-&gt;link(&apos;Alias&apos;, $id) throws an exception because of getIdentifier returns array, not string</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-776</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I want to bookmark ads on my site. So i have Ads table, users table (sfDoctrineGuard) and a refclass Bookmarks. I&apos;ve created an ajax link to an action, where i retrieved $ad object, $user_id and &lt;br/&gt;
$ad-&amp;gt;link(&apos;Bookmarks&apos;, $user_id, true);&lt;br/&gt;
So I expected a record in a database to be created. &lt;/p&gt;

&lt;p&gt;Bookmarks:&lt;br/&gt;
...&lt;br/&gt;
  columns:&lt;br/&gt;
    user_id: &lt;/p&gt;
{ type: integer(4), primary: true }
&lt;p&gt;    ad_id:  &lt;/p&gt;
{ type: integer(4), primary: true }
&lt;p&gt;  relations:&lt;br/&gt;
    sfGuardUser: &lt;/p&gt;
{ onDelete: CASCADE, local: user_id, foreign: id }
&lt;p&gt;    Ads: &lt;/p&gt;
{ onDelete: CASCADE, local: ad_id,  foreign: ad_id }

&lt;p&gt;As my Bookmarks table has 2 primary keys in the link method &lt;/p&gt;

&lt;p&gt;            if (count($ids) &amp;gt; 0) &lt;/p&gt;
{
                $q-&amp;gt;whereIn($rel-&amp;gt;getTable()-&amp;gt;getIdentifier(), array_values($this-&amp;gt;identifier()));
            }

&lt;p&gt;$rel-&amp;gt;getTable()-&amp;gt;getIdentifier() returned me an array(&apos;user_id&apos;, &apos;ad_id&apos;) instead of a string. So the query which was generated looked like&lt;br/&gt;
UPDATE bookmarks SET ad_id = ? WHERE (Array IN &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/help_16.gif&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;)&lt;br/&gt;
And Array is not the name of a column.&lt;/p&gt;

&lt;p&gt;My schema:&lt;br/&gt;
&lt;a href=&quot;http://pastie.org/private/2lr9gy1h3mtdwdsiwrwylq&quot; class=&quot;external-link&quot;&gt;http://pastie.org/private/2lr9gy1h3mtdwdsiwrwylq&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I&apos;ve solved an issue by creating a new Bookmark instance and saving it, but i presume that issue might distract someone.&lt;/p&gt;</description>
                <environment>Symfony 1.4.6-DEV</environment>
            <key id="11588">DC-776</key>
            <summary>$record-&gt;link(&apos;Alias&apos;, $id) throws an exception because of getIdentifier returns array, not string</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="charnad">Viktoras Bezaras</reporter>
                        <labels>
                    </labels>
                <created>Mon, 5 Jul 2010 18:01:58 +0000</created>
                <updated>Mon, 5 Jul 2010 18:05:14 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Record</component>
                <component>Relations</component>
                <component>Schema Files</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
            <subtask id="11587">DC-775</subtask>
        </subtasks>
        </item>

<item>
            <title>[DC-749] Doctrine_Record#getMutators() triggers PHP notice</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-749</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;When calling &lt;tt&gt;getMutators()&lt;/tt&gt; on an instance of Doctrine_Record (eg. &lt;tt&gt;$user = new User();&lt;/tt&gt;), if it hasn&apos;t any defined custom mutator yet, we get a&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;Notice: Undefined index: User in /[...]/Doctrine/Record.php on line 1312
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;whereas there&apos;s no error with &lt;tt&gt;getAccessors()&lt;/tt&gt; (I suppose it was fixed for the second one but not copied to the first one).&lt;/p&gt;

&lt;p&gt;Patch is &lt;b&gt;really&lt;/b&gt; simple! please see attachment &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;Regards&lt;/p&gt;</description>
                <environment>Doctrine SVN 1.2 r7676</environment>
            <key id="11515">DC-749</key>
            <summary>Doctrine_Record#getMutators() triggers PHP notice</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="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="gx">Guilliam X</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Jun 2010 10:30:57 +0000</created>
                <updated>Thu, 17 Jun 2010 10:30:57 +0000</updated>
                                    <version>1.2.2</version>
                                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="10667" name="DC-749.patch" size="499" author="gx" created="Thu, 17 Jun 2010 10:30:57 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>