Note that there are some explanatory texts on larger screens.

plurals
  1. POdoctrine 2 join problem [with xml mappers]
    text
    copied!<p>I try to join two tables but get stuck writing correct xml mappers (setup and entity access tested and works fine)</p> <ul> <li>Based on MySQL, Doctrine 2.0.4 and ZF-1.11</li> <li>I am using the XmlDriver( 'path\to\mappers );</li> </ul> <p><strong>Query</strong></p> <pre><code>$query = $em-&gt;createQueryBuilder() -&gt;select('u') -&gt;from('\Entities\Users', 'u') -&gt;leftJoin('u.Addresses', 'a') -&gt;getQuery(); $info = $query-&gt;getResult(); </code></pre> <p><strong>Mapper</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"&gt; &lt;entity name="Entities\Users" table="users"&gt; &lt;change-tracking-policy&gt;DEFERRED_IMPLICIT&lt;/change-tracking-policy&gt; &lt;id name="id" type="integer" column="id"&gt; &lt;generator strategy="IDENTITY"/&gt; &lt;/id&gt; &lt;field name="name" type="string" column="name"/&gt; &lt;many-to-one field="street" target-entity="Addresses" /&gt; &lt;/entity&gt; &lt;/doctrine-mapping&gt; </code></pre> <p>But with all possible relations (I am getting tired here :) I always get the same problem: The property of the related entity is not found:</p> <blockquote> <p>Doctrine\ORM\Mapping\MappingException - Property street does not exist</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload