How Yii2 deals with intermediary tables?


I have a question regarding Many to Many relationships please.

Lets say we have a table Users and a table Classes.

I have just learned from a video on the internet that for a good database design, you should not link both tables together but use an Intermediary table in between that store the values of both the other tables.

How will Yii2 behave in this case, is there any special setup to do please?

Or can I just create the tables in mysql with the foreign keys and have Yii2 recognizing them right away?

Thank you,


yes, yii would recognise those relationships as long as you define them in mysql

Thank you so much Michel!