title: The target-entity cannot be found in the same namespace
body: <p>Hi guys I've a strange fault.</p>
  
  <p>I've two entities and they are in the same namespace, but they are not in the same folder:<br>
  - The Card entity is in AppBundle\Entity\Card folder<br>
  - The Minnie entity is in AppBundle\Entity\Card\Subfolder folder<br>
  When I use the Card entity, it says:</p>
  
  <blockquote>
    <p>The target-entity AppBundle\Entity\Card\Minnie cannot be found in 'AppBundle\Entity\Card\Card#minnies'.</p>
  </blockquote>
  
  <p>I can't understand why. I've searched in this forum, and everyone says that if two classes are in the same namespace, it needs only the entity's name when I use a referrer to Minnie's entity. Why in this case it doesn't work?</p>
  
  <p>Card Class:</p>
  
  <pre><code>namespace AppBundle\Entity\Card;
  
  use Doctrine\ORM\Mapping as ORM;
  use Symfony\Component\Validator\Constraints as Assert;
  use Doctrine\Common\Collections\ArrayCollection;
  
  /**
   * @ORM\Entity
   * @ORM\Table(name="card")
   */
  class Card {
      /**
       * @ORM\Id
       * @ORM\Column(type="integer")
       * @ORM\GeneratedValue
       */
      private $id;
  
  /**
   * @ORM\Column(length=55)
   */
  private $name;
  
  /**
   * Many Cards have Many Pippos.
   * @ORM\ManyToMany(targetEntity="Pippo", inversedBy="cards")
   * @ORM\JoinTable(name="pippo_jointable")
   */
  private $pippos;
  
  /**
   * Many Cards have Many Topolinos.
   * @ORM\ManyToMany(targetEntity="Topolino", inversedBy="cards")
   * @ORM\JoinTable(name="topolino_jointable")
   */
  private $topolinos;
  
  /**
   * Many Cards have Many Minnie.
   * @ORM\ManyToMany(targetEntity="Minnie", inversedBy="cards")
   * @ORM\JoinTable(name="minnie_jointable")
   */
  private $minnies;
  
  public function __construct() {
      $this-&gt;pippos= new ArrayCollection();
      $this-&gt;topolinos = new ArrayCollection();
      $this-&gt;minnies = new ArrayCollection();
  }
  }
  </code></pre>
  
  <p>Minnie's Class:</p>
  
  <pre><code>namespace AppBundle\Entity\Card;
  
  use Doctrine\ORM\Mapping as ORM;
  use Symfony\Component\Validator\Constraints as Assert;
  use Doctrine\Common\Collections\ArrayCollection;
  
  /**
   * @ORM\Entity
   * @ORM\Table(name="minnie")
   */
  class Minnie {
      /**
       * @ORM\Id
       * @ORM\Column(type="integer")
       * @ORM\GeneratedValue
       */
      private $id;
  
  /**
   * @ORM\Column(length=55)
   */
  private $name;
  
  /**
   * Many Minnie have Many Cards.
   * @ORM\ManyToMany(targetEntity="Card", mappedBy="minnies")
   */
  private $cards;
  
  public function __construct() {
      $this-&gt;cards = new ArrayCollection();
  }
  }
  </code></pre>
  
  <p>If it can help, this is the code that uses the Card entity:</p>
  
  <pre><code>namespace AppBundle\Controller\Admin;
  
  use AppBundle\Entity\Card\Card;
  use AppBundle\Form\CardType;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  use Symfony\Component\HttpFoundation\Request;
  
  class CardController extends Controller
  {
      /**
       * @Route("/admin/create-card", name="create-card")
       */
      public function adminCardMainPageAction(Request $request) {
          $card = new Card();
          $em = $this-&gt;getDoctrine()-&gt;getManager();
          $form = $this-&gt;createForm(CardType::class, $card);
          $form-&gt;handleRequest($request);
          return $this-&gt;render('/admin/card-creation.html.twig', array(
              'form' =&gt; $form-&gt;createView()
          ));
      }
  }
  </code></pre>