Well, if Books can have more than one Author in your system then it's:
    Authors hasAndBelongsToMany Books
    Books hasAndBelongsToMany Authors

But if each book can only have one Author then it would be:
    Authors hasMany Books
    Book belongsTo Author

with the foreign keys set up as required.

Please read the Cookbook - 
http://book.cakephp.org/view/78/Associations-Linking-Models-Together

On Aug 7, 8:29 am, Rawna <[email protected]> wrote:
> On Aug 7, 2:48 am, Vijay Kumbhar <[email protected]> wrote:
>
> > Better way please create new table that will take the book_id & the
> > auther_id so that you can associate the models.
>
> What Model relationship should I do to create that? Could you please
> give an example?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to