I’d like to have a OneToOne mapping from an Entity in one Bundle to an Entity in another. I have:
# KWI\SeniorProjectBundle\Entity\Project:
use KWI\PeopleBundle\Entity\User;
/**
* @ORM\OneToOne(targetEntity="\KWI\PeopleBundle\Entity\User")
*/
protected $mentor;
Yet running doctrine:schema:update gives the following error:
[Doctrine\ORM\Mapping\MappingException]
Class KWI\PeopleBundle\Entity\User is not a valid entity or mapped super class.
Both entities reside in different databases (realized through two separate entity managers which use two separate DB connections).
Is this even possible to accomplish? I have the feeling that it’s actually pretty common to have different databases that have mappings between each other. So this should be possible, right?
Doctrine doesn’t seem to support mappings across databases. Moving both entities into the same entity manager resolves the issue.