Magento Collections and Many to Many relationships & crud
I haven't found a very convenient way of making a collection from a many to many relationship.
Ideally, I'd like to be able to call the toArray() method and end up with something like:
id => 1,
value_field => array('foo','bar')
id => 2,
value_filed => array('baz', 'qux')
..
To complicate this, i'd like to be able to load this many to many relationship into a backend CRUD and on save, update the proper values in the linkage tab开发者_Python百科le.
I'm currently thinking about using an afterLoad and afterSave to build and save the collection / POSTed data, but I've seen this done in a more pratical/automagic way in other frameworks an cant see that Magento hasn't handled this.
Any suggestions?
(No) answer here: FK and M2M realtions in Magento thanks to Alan Storm.
精彩评论