Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best way to deal with junction table and its extra columns #131

Open
bpbastos opened this issue Jul 13, 2016 · 5 comments
Open

Best way to deal with junction table and its extra columns #131

bpbastos opened this issue Jul 13, 2016 · 5 comments

Comments

@bpbastos
Copy link

Would be nice a recipe about this subject.

@samdark
Copy link
Owner

samdark commented Jul 13, 2016

What do you want to do with it?

@bpbastos
Copy link
Author

bpbastos commented Jul 13, 2016

It was a suggestion of recipe to be included in the cookbook. Sorry if I created it in the wrong place.

@samdark
Copy link
Owner

samdark commented Jul 13, 2016

No, it's correct place. I've asked because I want to understand your use case to get a better recipe.

@bpbastos
Copy link
Author

Nice! It's a common problem, unfortunately I haven't found a good way of dealing with this without being too much complex. I've found a good article: http://future500.nl/articles/2013/09/doctrine-2-how-to-handle-join-tables-with-extra-columns/ maybe someone can migrate it to yii2.

@samdark
Copy link
Owner

samdark commented Jul 13, 2016

In general, you need to create a model for that junction table and use it via relations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants