I\'m trying to use Doctrine 2 in a ZF2 application which contains two modules, each with its own database. I need to use cross-database joins so that I can associate entitie
I managed to fix it. In my Server\Entity\Server
, I had these getter/setter functions for adding/removing websites:
public function setWebsite(Website $website)
{
$this->websites->add($website);
}
public function removeWebsite(Website $website)
{
$this->websites->removeElement($website);
}
But you need to specify the full namespace as the argument:
public function setWebsite(\Client\Entity\Website $website) { ... }
Such a stupid mistake! I found the issue because I trawled through every file in the stack-trace and got to the point where it was attempting to save every method/argument in my Entity class to a proxy file (line 223ish in Doctrine/ORM/Proxy/ProxyFactory.php).