Doctrine2: Best way to handle many-to-many with extra columns in reference table

后端 未结 14 2198
灰色年华
灰色年华 2020-11-22 10:44

I\'m wondering what\'s the best, the cleanest and the most simply way to work with many-to-many relations in Doctrine2.

Let\'s assume that we\'ve got an album like

14条回答
  •  一个人的身影
    2020-11-22 11:27

    What you are referring to is metadata, data about data. I had this same issue for the project I am currently working on and had to spend some time trying to figure it out. It's too much information to post here, but below are two links you may find useful. They do reference the Symfony framework, but are based on the Doctrine ORM.

    http://melikedev.com/2010/04/06/symfony-saving-metadata-during-form-save-sort-ids/

    http://melikedev.com/2009/12/09/symfony-w-doctrine-saving-many-to-many-mm-relationships/

    Good luck, and nice Metallica references!

提交回复
热议问题