<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Wed May 22 19:53:43 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-116/DDC-116.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-116] array_combine error when using combined Primary Key</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-116</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I use a combined Primary Key for a User&apos;s Phonenumber entity (to match our existing DB model). The key is combined from a &quot;Type&quot; field and a &quot;userId&quot; field that references the User table. &lt;/p&gt;

&lt;p&gt;To mark the (referenced!) userId field and the type field as PK, I need to add &quot;userId&quot; to the model (adding @Id to User does not work). This works well when generating Users and Phonenumbers - but the delete command breaks:&lt;/p&gt;

&lt;div class=&quot;panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelContent&quot;&gt;
&lt;p&gt;PHP Warning:  array_combine(): Both parameters should have an equal number of elements in ..../lib/Doctrine/ORM/Persisters/StandardEntityPersister.php on line 274&lt;br/&gt;
PHP Catchable fatal error:  Argument 2 passed to Doctrine\DBAL\Connection::delete() must be an array, boolean given, called in ..../lib/Doctrine/ORM/Persisters/StandardEntityPersister.php on line 275 and defined in ..../lib/Doctrine/DBAL/Connection.php on line 372&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Entities:&lt;br/&gt;
&lt;a href=&quot;http://pastebin.com/d51e021e2&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/d51e021e2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Test code:&lt;br/&gt;
&lt;a href=&quot;http://pastebin.com/m51d1f497&quot; class=&quot;external-link&quot;&gt;http://pastebin.com/m51d1f497&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="10343">DDC-116</key>
            <summary>array_combine error when using combined Primary Key</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="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="nicokaiser">Nico Kaiser</reporter>
                        <labels>
                    </labels>
                <created>Thu, 5 Nov 2009 08:10:50 +0000</created>
                <updated>Mon, 14 Jun 2010 09:17:44 +0000</updated>
                    <resolved>Fri, 6 Nov 2009 10:30:36 +0000</resolved>
                                            <fixVersion>2.0-ALPHA3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="10518" author="nicokaiser" created="Fri, 6 Nov 2009 09:07:25 +0000"  >&lt;p&gt;I attached a patch for Doctrine\Orm\Id\Assigned, there seems to be a runaway line which makes the class add each element twice...&lt;/p&gt;</comment>
                    <comment id="10520" author="romanb" created="Fri, 6 Nov 2009 09:39:17 +0000"  >&lt;p&gt;Whoops. Thanks for finding this! Does it fix this issue? I will need to add a testcase to the suite.&lt;/p&gt;</comment>
                    <comment id="10521" author="nicokaiser" created="Fri, 6 Nov 2009 09:43:56 +0000"  >&lt;p&gt;Does not entirely fix it: if the $value is empty, too few elements are added again. &lt;br/&gt;
Need to remove the &quot;if (isset($value)) {&quot; clause. I&apos;ll attach the fixed Assigned.php.&lt;/p&gt;</comment>
                    <comment id="10522" author="romanb" created="Fri, 6 Nov 2009 09:50:56 +0000"  >&lt;p&gt;I think the isset() is correct. That way the $identifier array remains empty if the PK is null and later if ( ! $identifier) evaluates to false on the empty array and raises the exception. If we remove the isset() we would &quot;accept&quot; PKs with null values. But it might be better to do:&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;if&lt;/span&gt; (!isset($value)) {
        &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; ORMException::entityMissingAssignedId($entity);
  } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
         $identifier[] = $value;
 }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    <comment id="10523" author="romanb" created="Fri, 6 Nov 2009 10:09:49 +0000"  >&lt;p&gt;I will fix this and add some new tests for it.&lt;/p&gt;</comment>
                    <comment id="10524" author="romanb" created="Fri, 6 Nov 2009 10:30:36 +0000"  >&lt;p&gt;Should be fixed now.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10143" name="Assigned.php" size="2329" author="nicokaiser" created="Fri, 6 Nov 2009 09:43:56 +0000" />
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>