<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Tue May 21 06:53:00 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/si/jira.issueviews:issue-xml/DC-1020/DC-1020.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

<item>
            <title>[DC-1020] In the Timestampable Listener, the &apos;alias&apos; behavior option is not used when determining the database fieldname</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-1020</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;I noticed this issue after setting up timestampable behavior on an aliased column in a legacy table:&lt;/p&gt;


&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
&amp;lt;?php

&lt;span class=&quot;code-keyword&quot;&gt;abstract&lt;/span&gt; class Content_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;setTableName(&apos;t_content&apos;);
    
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;id&apos;, &apos;integer&apos;, 11, array(&apos;primary&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;, &apos;autoincrement&apos; =&amp;gt; &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;));
    &lt;span class=&quot;code-comment&quot;&gt;// ...
&lt;/span&gt;    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;datePost as posted_at&apos;, &apos;timestamp&apos;);
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;hasColumn(&apos;dateEdit as updated_at&apos;, &apos;timestamp&apos;);
    &lt;span class=&quot;code-comment&quot;&gt;// ...
&lt;/span&gt;    
  }
  
  &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setUp()
  { 
    &lt;span class=&quot;code-comment&quot;&gt;// ..
&lt;/span&gt;    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;actAs(&apos;Timestampable&apos;, array(&apos;created&apos; =&amp;gt; array( &apos;name&apos; =&amp;gt; &apos;datePost&apos;,
                                                            &apos;alias&apos; =&amp;gt; &apos;posted_at&apos;),
                                        &apos;updated&apos; =&amp;gt; array( &apos;name&apos; =&amp;gt; &apos;dateEdit&apos;,
                                                            &apos;alias&apos; =&amp;gt; &apos;updated_at&apos;)));
  }

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

&lt;p&gt;Before I added timestampable to this model, I was setting the timestamp fields manually, which worked fine.&lt;/p&gt;

&lt;p&gt;I had to look at the source to find the alias option in the timestampable behavior, since it does not appear to be in the 1.2 documentation. (If this issue is invalid because it&apos;s not an officially supported option, I apologize).&lt;/p&gt;

&lt;p&gt;After I added timestampable to the model, Doctrine began throwing an exception when I tried to save a new record:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Error: Doctrine_Record_UnknownPropertyException [ 0 ]: Unknown record property / related component &quot;datePost&quot; on &quot;Content_Article&quot; ~ &lt;span class=&quot;error&quot;&gt;&amp;#91;...&amp;#93;&lt;/span&gt;/Doctrine-1.2.4/Doctrine/Record/Filter/Standard.php&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;It appears that the alias option is used when setting the table definition in the behavior template, but not used by the template&apos;s listener when creating, updating, etc.&lt;/p&gt;

&lt;p&gt;I&apos;m attaching a zip with a copy of the changes I made to fix this in 1.2.4 and a git patch.&lt;/p&gt;</description>
                <environment>PHP 5.3.5, MySQL 5.5.9; as well as PHP 5.3.6, MySQL 5.0.92</environment>
            <key id="12834">DC-1020</key>
            <summary>In the Timestampable Listener, the &apos;alias&apos; behavior option is not used when determining the database fieldname</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="wam">Will Mitchell</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Jul 2011 05:41:26 +0000</created>
                <updated>Tue, 19 Jul 2011 05:41:26 +0000</updated>
                                    <version>1.2.2</version>
                <version>1.2.3</version>
                <version>1.2.4</version>
                                                <component>Timestampable</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                    <attachment id="11030" name="Doctrine_Timestampable_Alias.zip" size="6474" author="wam" created="Tue, 19 Jul 2011 05:41:26 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>