Understanding model relationships

Now we shall see different types of object relations. They are as follows :

  • One-to-many relation
  • Many-to-many relation
  • One-to-one relation
  • Polymorphic relations

The one to many relation

Let's get back to Sodibee! Let's assume that one book has one author. In a relationship statement, this means, "An Author has many books" and "A book belongs to one author". We write a relationship exactly like this.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.155.84