<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Sun May 26 07:31:29 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/DDC-1376/DDC-1376.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>[DDC-1376] Foreign key not available to order when using findBy()</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-1376</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</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;&amp;lt;?php
/**
 * Service
 *
 * @Entity(repositoryClass=&lt;span class=&quot;code-quote&quot;&gt;&quot;App_Model_Repository_Si_Service&quot;&lt;/span&gt;)
 * @Table(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;service&quot;&lt;/span&gt;)
 */
class App_Model_Entities_Si_Service
{
   /**
    * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;
    *
    * @Id
    * @GeneratedValue(strategy=&lt;span class=&quot;code-quote&quot;&gt;&quot;SEQUENCE&quot;&lt;/span&gt;)
    * @Column(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;pk&quot;&lt;/span&gt;, type=&lt;span class=&quot;code-quote&quot;&gt;&quot;integer&quot;&lt;/span&gt;)
    */
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; $pk;

    /**
     * Service parent
     * @&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; App_Model_Entities_Si_Service
     *
     * @ManyToOne(targetEntity=&lt;span class=&quot;code-quote&quot;&gt;&quot;App_Model_Entities_Si_Service&quot;&lt;/span&gt;, cascade={&lt;span class=&quot;code-quote&quot;&gt;&quot;all&quot;&lt;/span&gt;}, inversedBy=&lt;span class=&quot;code-quote&quot;&gt;&quot;service&quot;&lt;/span&gt;)
     * @JoinColumn(name=&lt;span class=&quot;code-quote&quot;&gt;&quot;pk_service&quot;&lt;/span&gt;, referencedColumnName=&lt;span class=&quot;code-quote&quot;&gt;&quot;pk&quot;&lt;/span&gt;)
     */
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; $service;

   /**
    * Returns an App_Model_Entities_Si_Service that represents the service
    *
    * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; App_Model_Entities_Si_Service
    */
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getService(){
      &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;service;
   }
   /**
    * Set an App_Model_Entities_Si_Service that represents a service
    *
    * @param App_Model_Entities_Si_Service $newService
    */
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setService($newService){
      $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;service = $newService;
   }
}

&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;$service = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;service(&apos;Service_Type&apos;, &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
$serviceType = $service-&amp;gt;findOneBy(array(&apos;code&apos; =&amp;gt; &apos;service&apos;));
        
$service = $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;service(&apos;Service&apos;, &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
$services = $service-&amp;gt;findBy(
    array(&apos;serviceType&apos; =&amp;gt; $serviceType-&amp;gt;getPk()),
    array(&apos;service&apos; =&amp;gt; &apos;ASC&apos;)
);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Using orderBy parameter of EntityRepository::findBy() with Foreign Key do not work.&lt;br/&gt;
An Unrecognized field error occured.&lt;/p&gt;

&lt;p&gt;Of course, i can use DQL but i think this function should work with mapping.&lt;/p&gt;

&lt;p&gt;Thank you in advance&lt;/p&gt;</description>
                <environment></environment>
            <key id="13019">DDC-1376</key>
            <summary>Foreign key not available to order when using findBy()</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="fabio.bat.silva">Fabio B. Silva</assignee>
                                <reporter username="presteus">Presteus</reporter>
                        <labels>
                    </labels>
                <created>Wed, 14 Sep 2011 14:17:51 +0000</created>
                <updated>Mon, 14 Jan 2013 02:35:31 +0000</updated>
                    <resolved>Mon, 14 Jan 2013 02:35:31 +0000</resolved>
                            <version>2.1.1</version>
                                <fixVersion>2.4</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="16480" author="beberlei" created="Thu, 15 Sep 2011 16:19:49 +0000"  >&lt;p&gt;Not a bug&lt;/p&gt;</comment>
                    <comment id="19314" author="fabio.bat.silva" created="Mon, 14 Jan 2013 02:35:31 +0000"  >&lt;p&gt;Fixed : &lt;a href=&quot;https://github.com/doctrine/doctrine2/commit/b30b06852bc4eacf8bbbed472e1d6ec21310ec0a&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/doctrine2/commit/b30b06852bc4eacf8bbbed472e1d6ec21310ec0a&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>