title: Issue with Inheritance Mapping of Doctrine and Symfony2?
body: <p>I complete the work on symfony2 project that already implemented by another developer, my issue is with Inheritance Mapping, I have a declaration like that : </p>
  
  <pre><code>/**
   * @ORM\Entity(repositoryClass="Myapp\MyBundle\Entity\Repository\ProductRepository")
   * @ORM\Table(name="product")
   * @ORM\InheritanceType("JOINED")
   * @ORM\DiscriminatorColumn(name="inheritance", type="smallint")
   * @ORM\DiscriminatorMap(
   *         { 0 = "Product",
   *           1 = "Hotel", 2 = "Attraction", 3 = "Tour",
   *           4 = "Car", "5" = "Transfer"})
   */
   abstract class Product
   {
   ....
  </code></pre>
  
  <p>and Transfer class : </p>
  
  <pre><code>/**
   * Transfer
   *
   * @ORM\Table(name="transfer")
   * @ORM\Entity(repositoryClass="Myapp\MyBundle\Entity\Repository\TransferRepository")
   */
   class Transfer extends Product
   {
    ....
  </code></pre>
  
  <p>when I call Transfer class in my controller like that: </p>
  
  <pre><code>$em-&gt;getRepository('MyappMyBundle:Transfer')-&gt;findAll();
  </code></pre>
  
  <p>I get this error : </p>
  
  <pre><code>Method "name" for object "Myapp\MyBundle\Entity\Hotel" does not exist in MyappMyBundle:Transfer:index.html.twig at line 142
  </code></pre>
  
  <p>I don't know why symfony2 insist to call Hotel class even I call transfer class?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Here the hotel class :</p>
  
  <pre><code>/**
   * @ORM\Table(name="hotel")
   * @ORM\Entity(repositoryClass="Myapp\MyBundle\Entity\Repository\HotelRepository")
   */
   class Hotel extends Product
   {
  </code></pre>
  
  <p>index.html.twig</p>
  
  <pre><code> ......
  {% for t in transfers %}
  
                      &lt;td&gt;{{t.name}}&lt;/td&gt;
   {% endfor %}
  </code></pre>
  
  <p>The only remark I can add, when I change hotel class by transfer class in product class, the call of transfer class works fine  and about hotel class he call transfer class?</p>
  
  <pre><code>  * @ORM\DiscriminatorMap(
    *         { 0 = "Product",
    *           1 = "Transfer", 2 = "Attraction", 3 = "Tour",
    *           4 = "Car", "5" = "Hotel"})
  </code></pre>