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

2013-09-16 Thread John Andersen
Correction to this part:
 

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

Should be:
 

> Suggest you to take a look at the Model and the Behaviour Containable in 
> the CakePHP book/documentation.
>

Enjoy, John 

-- 
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+unsubscr...@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.


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

2013-09-16 Thread John Andersen
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+unsubscr...@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.


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

2013-09-05 Thread Simon Males
class FirstModel extends AppModel
{
  public $hasOne = array('Second');
  public $hasMany = array('Third');
}

class SecondModel extend AppModel
{
  public $belongsTo = array('First');
}

class ThirdModel extend AppModel
{
  public $belongsTo = array('First');
}

On Fri, Sep 6, 2013 at 10:13 AM, 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+unsubscr...@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.



-- 
Simon Males

-- 
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+unsubscr...@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.


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

2013-09-05 Thread Sam
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+unsubscr...@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.