Monday, September 16, 2013

Re: Is nested one-to-many table relationships possible in CakePHP?

The short answer is Yes as CakePHP supports nearly whatever relationships you design in your database.

You relationships are as this:

Table1 -> hasMany -> Table2 -> hasMany -> Table3

With CakePHP you can find data from Table1 alone, from Table1 including Table2, and also from Table1 including Table2 including Table3 - as your data is related.

Suggest you to take a look at the Model and the ModelHelper Contains in the CakePHP book/documentation.

Enjoy, John

On Friday, 6 September 2013 05:13:37 UTC+3, Sam wrote:
Dear CakePHP experts,

While designing a database structure, I created 3 tables. There is a 1-to-many relationship between the first table and second table. There is another 1-to-many relationship between the second table and third table. Does CakePHP allow this kind of table relationship? I hope this does not sound like a stupid question to the experts here.




--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: