douchensi8625 2011-03-02 15:25
浏览 26
已采纳

Magento Collections和多对多关系&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 table.

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?

  • 写回答

1条回答 默认 最新

  • doufu9521 2011-03-07 13:01
    关注

    (No) answer here: FK and M2M realtions in Magento thanks to Alan Storm.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度