I'm working on a framework on which I wish to integrate Doctrine.
The already established structure works this way:
Productstable:productId(PK)
Categoriestable:categoryId(PK)
etc. for other entities.
Where it gets complex is that, in order to introduce a "Multi-Store" concept, the framework introduces an additional table:
ObjectSharingtable:ObjectId(PK)ObjectType(PK) -> ('product','category', etc.)StoreId(PK)
With a composite primary key on the three columns of the table.
How can I model this in Doctrine? I have tried multiple options:
- Class table inheritance (issue with the three primary keys, and the fact that a discriminator cannot be part of a primary key)
- Many-to-one relationships from
ObjectSharing, with an abstractSharedObjectentity from which I override the ids in the submethods, but I still get issues
Thanks for your help.
Aucun commentaire:
Enregistrer un commentaire