title: How to define default Entity Manager for Symfony Entities
body: <p>I am setting up an App with multiple databases, each database has its own entity manager.</p>
  <p>When I query the data and specify the entity manager for the entity, it works fine.</p>
  <p>I cannot create a form that has a relationship (both entities use the same entity manager).</p>
  <p>I get the following error when trying to render a form to create a new entity</p>
  <blockquote>
  <p>[Semantical Error] Couldn't find constant App\Repository\Admin\Item\ItemsRepository, class App\Entity\Item\Items.</p>
  </blockquote>
  <pre><code>// App/Entity/Item/Items.php
  /**
   * Items
   *
   * @ORM\Entity(repositoryClass=App\Repository\Admin\Item\ItemsRepository)
   * @ORM\Table(name=&quot;items&quot;)
   * @ORM\Entity
   */
  class Items
  {
  ....
  }
  </code></pre>
  <pre><code>// App/Repository/Item/ItemsRepository.php
  namespace App\Repository\Admin\Item;
  
  use App\Entity\Item\Items;
  use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
  use Doctrine\Persistence\ManagerRegistry;
  
  /**
   * @method Items|null find($id, $lockMode = null, $lockVersion = null)
   * @method Items|null findOneBy(array $criteria, array $orderBy = null)
   * @method Items[]    findAll()
   * @method Items[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
   */
  class ItemsRepository extends ServiceEntityRepository
  {
  ...
  }
  </code></pre>
  <pre><code>#config/package/doctrine.yaml   
      orm:
          default_entity_manager: default
          entity_managers:
              default:
                  connection: default
                  mappings:
                      App:
                          is_bundle: false
                          type: annotation
                          dir: '%kernel.project_dir%/src/Entity/Default'
                          prefix: 'App\Entity\Default'
              item_service:
                  connection: item_service
                  mappings:
                      ItemAlias:
                          is_bundle: false
                          type: annotation
                          dir: '%kernel.project_dir%/src/Entity/Item'
                          prefix: 'App\Entity\Item'
                          alias: ItemAlias
  </code></pre>
  <p>Overall file structure:</p>
  <pre><code>src
    Controller
      Admin
        Item
          UnitConversionsController.php
    Entity
      Item
        Items.php
    Repository
      Admin
        Item
          ItemsRepository.php
  </code></pre>
  <p>I'd be happy if there was a way to manually define the entity manager that the Type class is using to pull the related data for populating the form.</p>
  <p>How do I get symfony to recognize a default entity manager for a directory of entities?</p>