Seems like a good approach, when you have a data-model that fits
the has-many-through architecture… but what about a strict
many_many relation? Are you considering versioning for these as
well?
--
You received this message because you are subscribed to the Google Groups "SilverStripe Core Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to silverstripe-d...@googlegroups.com.
To post to this group, send email to silverst...@googlegroups.com.
Visit this group at https://groups.google.com/group/silverstripe-dev.
For more options, visit https://groups.google.com/d/optout.
I see. Wouldn't that lead to several unnecessary DataObjects that are just being used as intermediate objects? Seems pretty unintuitive to set up a plain many_many relation…
Have you considered something like different join tables for the different stages? Eg. if you have "Page - many_many - Images", you would get "Page_Images", "Page_Images_Live" and "Page_Images_versions" join tables?
I guess the drawback of this is, that it's introducing a special
case to version many_many relations… and your approach uses
already existing tools.
But my most common use case for many_many are File relations by a large margin. So I would end up in doing something like this?
Page - has-many - PageImageHolderObject
Image - has-many - PageImageHolderObject
Page - many-many - Images through PageImageHolderObject
Or did I misunderstand the many-many-through architecture? Could you make an example how to set up a Page - many-many - Files relation with many-many-through?
Thanks - Roman