I have a few Entities that I would like to be able to map Comments to (Profiles, Posts, Images, Videos - things like that).
Each of these Entities has a column that contains a guid, and what I would like to do is have the Comment table hold the guid to the item to which it belongs. What I can't figure out is how to configure Doctrine to handle this kind of thing so that the joins work. The solution I think might work is to use NativeSql (although I am not sure that will work either), but would rather not have to do that if at all possible.
I don't imagine I am the first one to encounter this problem, so I hope someone out there can help!
Thanks.
I think you can use inheritance mapping for that, can't you? You will need something like CommentableEntity, from which Profiles, Posts, Images, Videos are inherited.
It adds some overhead and you need to check if it's ok for your task.