Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
ORM additional fields in relationship table
  • Is there a good way to work with additional fields in the ORM many-to-many relationship tables?

    Ex: I have a movies_movielists table that is used to establish a relationship when a movie is added to a list. I would like to be able to add a 'added_by' and 'date_added' values but can't figure out how to do that via ORM.

    Thanks!
  • HarroHarro
    Accepted Answer
    If the through table has attributes, it's not a through table anymore, it needs a model, and your many-to-many will become two one-to-many's with the new model in the middle.

    For easy of use you can leave the many-2-many relation in place, so you can use both.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion