<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sat May 25 13:09: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-137/DC-137.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-137] Doctrine_Record_Generator does not autoload classes</title>
                <link>http://www.doctrine-project.org/jira/browse/DC-137</link>
                <project id="10031" key="DC">Doctrine 1</project>
                        <description>&lt;p&gt;Using the versionable behavior creates dynamic classes and does not autoload the models that are defined.  Removing the false flag from  if ($this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;generateFiles&amp;#39;&amp;#93;&lt;/span&gt; === false &amp;amp;&amp;amp; class_exists($this-&amp;gt;_options&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;className&amp;#39;&amp;#93;&lt;/span&gt;. false )) { line will fix the issue&lt;/p&gt;</description>
                <environment>CentOS 5.3, PHP 5.2.5</environment>
            <key id="10231">DC-137</key>
            <summary>Doctrine_Record_Generator does not autoload classes</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="jwage">Jonathan H. Wage</assignee>
                                <reporter username="bvoelsch">Brian Voelschow</reporter>
                        <labels>
                    </labels>
                <created>Fri, 23 Oct 2009 21:49:16 +0000</created>
                <updated>Wed, 2 Dec 2009 16:55:14 +0000</updated>
                    <resolved>Mon, 2 Nov 2009 23:23:32 +0000</resolved>
                            <version>1.2.0-ALPHA2</version>
                                <fixVersion>1.2.0-BETA1</fixVersion>
                                <component>Record</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="10291" author="jwage" created="Sat, 24 Oct 2009 01:03:12 +0000"  >&lt;p&gt;Hmm. I remember once upon a time this was this way for a reason. Can you show some code for what you&apos;re doing so I can test this myself. Are you writing the generated files to disk somewhere?&lt;/p&gt;</comment>
                    <comment id="10328" author="bvoelsch" created="Wed, 28 Oct 2009 14:56:33 +0000"  >&lt;p&gt;Jonathan,&lt;br/&gt;
  I wrote a model class so we can access the version history and display it in an application.  The code that we are using is just trying to save versions when we have database delegation.  We enabled the delegation code in our X_Doctrine_Record class.  When debugging the calls we noticed that the correct model does not get loaded, but the generated model did.  We need the model that we created so that our delegation will work and save the version to the master DB.&lt;/p&gt;

&lt;p&gt;Steps to Reproduce:&lt;br/&gt;
1. Add versionable behavior to an existing model&lt;br/&gt;
2. Create a model for the version table&lt;br/&gt;
3. Try to save an object.  Error returned - If you do not allow saves on your slave connection&lt;/p&gt;</comment>
                    <comment id="10329" author="jwage" created="Wed, 28 Oct 2009 15:24:40 +0000"  >&lt;p&gt;I see. The part where you create your own model class is not how this is intended to work. It is intended that you let Doctrine generate the model class for you.&lt;/p&gt;</comment>
                    <comment id="10330" author="bvoelsch" created="Wed, 28 Oct 2009 15:37:24 +0000"  >&lt;p&gt;Understood that this is not how the code is intended to work, but without having a model there is no way to get the complete history.  The only way right now to get the complete history of a record would be to loop through the version records after getting the max version from the original record.&lt;/p&gt;</comment>
                    <comment id="10331" author="jwage" created="Wed, 28 Oct 2009 15:40:25 +0000"  >&lt;p&gt;I&apos;m failing to understand. The behavior generates a model for you named ModelNameVersion and ModelName hasMany ModelNameVersion, no?&lt;/p&gt;</comment>
                    <comment id="10332" author="bvoelsch" created="Wed, 28 Oct 2009 15:48:23 +0000"  >&lt;p&gt;The relationship was not created.  We are adding it and going to some testing.  Get back to you&lt;/p&gt;</comment>
                    <comment id="10333" author="bvoelsch" created="Wed, 28 Oct 2009 17:38:38 +0000"  >&lt;p&gt;The relationship worked on the generated class, but there is still an issue.  Without creating a model for the version table, there is no way to use our delegation code.  This still causes the problem of saving to the slave. or reading from the master.&lt;/p&gt;</comment>
                    <comment id="10334" author="jwage" created="Wed, 28 Oct 2009 17:42:35 +0000"  >&lt;p&gt;Hmm. The model does exist though. It is called &quot;ModelNameVersion&quot; and it is auto generated for you by Doctrine_Record_Generator. It also has options to write the generated model to a path somewhere.&lt;/p&gt;</comment>
                    <comment id="10336" author="bvoelsch" created="Wed, 28 Oct 2009 22:09:27 +0000"  >&lt;p&gt;Without autoloading the class by removing the false flag in the generator code, the saved model will never get loaded.  Another issue is that when trying to use the saved generated class, we get an error that it cannot find the id field that it created.  The id field does not exist in the table.&lt;/p&gt;</comment>
                    <comment id="10430" author="jwage" created="Mon, 2 Nov 2009 23:23:32 +0000"  >&lt;p&gt;We&apos;ll give this change a try. If it causes some issues for people we may have to revert it. I remember that false argument being there for a reason but I can&apos;t remember and none of our tests pass without it.&lt;/p&gt;</comment>
                    <comment id="10453" author="bvoelsch" created="Tue, 3 Nov 2009 16:00:33 +0000"  >&lt;p&gt;If your tests are not passing then there must be a reason for it to be set to false.  I think a configuration option here would be a better solution.  Similar to the Doctrine::ATTR_AUTOLOAD_TABLE_CLASSES setting.&lt;/p&gt;</comment>
                    <comment id="10806" author="jazzslider" created="Fri, 20 Nov 2009 22:00:24 +0000"  >&lt;p&gt;For what it&apos;s worth, I&apos;m running r6785 of the &lt;a href=&quot;http://svn.doctrine-project.org/tags/1.2.0-BETA3&quot; class=&quot;external-link&quot;&gt;http://svn.doctrine-project.org/tags/1.2.0-BETA3&lt;/a&gt; tag, and the absence of the false argument is causing me some annoying issues.&lt;/p&gt;

&lt;p&gt;Based on the documentation/parameters/etc., I&apos;m assuming both of the following use cases are supposed to be possible:&lt;/p&gt;

&lt;p&gt;A. The ModelNameVersion class is generated on-the-fly as necessary, and never stored in the filesystem.&lt;br/&gt;
B. The ModelNameVersion class is generated once, stored in the filesystem, and subsequently autoloaded from there.&lt;/p&gt;

&lt;p&gt;Now, from what I can tell, both use cases work correctly even without the false argument on line 159; however, in case A, a PHP warning can be generated if one of the registered autoloaders doesn&apos;t check to see if the file exists before including it.  This appears to be the case with Zend_Loader_Autoloader_Resource, for instance; my guess is that it&apos;s designed that way such that non-existing files produce the same warnings you&apos;d get if you tried to include them manually ...but it doesn&apos;t play nice with Doctrine&apos;s expectations here (and heck, it may well be a bug on their part to write it that way).&lt;/p&gt;

&lt;p&gt;These warnings don&apos;t appear to affect any functionality ...the line 159 conditional still turns up false, allowing the class to be generated on the fly.  All the same, I&apos;d prefer not to have to turn off E_WARNING on my development machine just to avoid seeing these.  Since Doctrine can&apos;t really guarantee that all of the autoloaders registered with SPL are properly &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; avoiding such blind includes, it may make more sense to leave the false argument in place and avoid the warnings.&lt;/p&gt;

&lt;p&gt;Of course, I don&apos;t know what effect that would have on use case B; my guess is that it&apos;d break, since that&apos;s what this issue was originally about &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;  Is there another solution available that satisfies both use cases without raising any errors?&lt;/p&gt;

&lt;p&gt;Thanks!&lt;br/&gt;
Adam&lt;/p&gt;</comment>
                    <comment id="10971" author="ace" created="Wed, 2 Dec 2009 16:32:37 +0000"  >&lt;p&gt;Hi !&lt;/p&gt;

&lt;p&gt;I&apos;m using Zend Framework and Doctrine and I got warnings with Doctrine_Template_Searchable that was trying to load the Index classes of the Searchable behaviour.&lt;br/&gt;
And as you said, with the false argument of get_class() Zend_Framework failed...&lt;/p&gt;

&lt;p&gt;I tried with 1.9.6 of Zend_Framework and it still failed, although they seem to say in your external reference (&lt;span class=&quot;error&quot;&gt;&amp;#91;ZF-8364&amp;#93;&lt;/span&gt; Zend_Loader_Autoloader_Resource::autoload() should return false if no match is found) that it would be fixed in release 1.9.6...&lt;/p&gt;

&lt;p&gt;Here it is... it was just to point it out &lt;img class=&quot;emoticon&quot; src=&quot;http://www.doctrine-project.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="10972" author="jwage" created="Wed, 2 Dec 2009 16:55:14 +0000"  >&lt;p&gt;Doesn&apos;t the autoloader have an option to check if the file exists before trying to include it?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>