"Has and Belongs to Many"

The final association Cake can recognize for database table relationships is the "has and belongs to many" relationship. This relationship is powerful but also a little difficult to master. The more you experiment with "has and belongs to many" associations, the easier it will be to use them in your applications.

In short, I've already discussed a one-to-one relationship with the hasOne association, and the hasMany association shows you how a one-to-many relationship is managed in Cake. What about a many-to-many relationship?

0 0

Responses

  • zido_php
    • RATE
    Well as you mentioned, hasandbelongstomany deals with many to many relationships via a third table (which you would get via 3rd normal form of database design/normalization.) As you should never have a many to many relationship @zido_php
    5 months ago

Post a comment

  • Receive news updates via email from this site