Im wanting to create basic versioning of the Group changes for a Member. If someone gets added to a new group either programmatically or via the CMS I would like to version this.
There isn't an extend hook on ManyMany list add so I can't see a way of somehow 'listening' to the add() event on a manymany list. Perhaps subclassing ManyMany and Object::useCustom()?? (seems very hacky) Or should I create a pull request with the extend function included for this? I can see it being handy in many other cases..
Another solution I had was that given Many Many table aren't versionable, creating a Group_Member DO with 2 has many joins coming in form Member and Group and versioning this.
Do you need versioning with rollback, or just a journal of changes? The Versioned class is a DataExtension, so you won't be able to apply it to ManyManyList, which does not descend from DataObject. So it seems you'll either have to patch ManyManyList or its ancestors, or write your own Extension subclass.
I need a journal of changes. My idea of essentially replicating the Group_Member join table into a DataObject was a potential work around for ManyMany relations not being able to be versioned/journaled.
Ideally there would be a $this->extend() hook in ManyMany add(), then I could create an extension to work this in, however I'd prefer not to fork sapphire unless others deemed this reusable/a good idea.
Not sure what the protocol is on a change like this if I am not sure its best practice. Should I do a pull request? Then wait to hear feedback for core team?