I have a number of unrelated entities that I'd like to be able to add FileAttachment entities to. I'm using Doctrine2 (in the context of a Symfony project).
Before I started using Doctrine, I'd make a junction table with a discriminator column, like this:
file_id
entity_id
entity_type
So far as I can tell, with Doctrine I'll require a junction table for each entity type that has FileAttachment associations. I'd prefer to avoid that if possible. I found an NHibernate solution here. Is it possible to do something similar with Doctrine and can anybody point me at some documentation? I've read (umpty times now!) chapters 6 and 7 of the Doctrine manual. But I'm not finding what I'm looking for.