I'm currently writing a MappedSuperclass to store entity reference on an entity object. For example to store favorites for a user, it can be any kind of model (product, category of product or whatever).
The class contains deux fields :
- entityType : the class of the entity reference
- entityId : the id of the entity reference
Favorite entity class will extends this Superclass, and that's work.
I'm would like to know, if there is another (cleaner?) way to do this ?
Thanks for your inputs.