Hello Brian,
thank you for the information about containable. It works fine, except
for one problem. I use this code:
$this-E-find(
'all',
array(
'contain' = array(
'D' = array(
'fields' = array('D.title'),
I think I read somewhere (here in the group) that you need to include
the foreign keys in the fields definition, so containable can see
them!
Enjoy,
John
On Oct 1, 1:51 pm, Melanie Sommer melanie-som...@mailinator.com
wrote:
Hello Brian,
thank you for the information about containable. It
Hi John,
I think I read somewhere (here in the group) that you need to include
the foreign keys in the fields definition, so containable can see
them!
I read contain automatically also includes the foreign keys in it's
sql-query.
http://book.cakephp.org/view/474/Containable :
As you can see,
Yes, I read that too, and later in the text is this note:
When using 'fields' and 'contain' options - be careful to include all
foreign keys that your query directly or indirectly requires.
And to me it looks like you should ensure that you specify the primary
keys (id) and the foreign keys
Hello John,
I already tried putting all X.id and X.Y_id in the respective field
arrays - no change.
And this also does not explain, why cakephp does the right thing
automatically when I select B, C, D, F, and G, but not when selecting
A. What I do not understand is the difference between the
Problem solved. There was a typing error in the C model. Sorry!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this
No problem :)
On Oct 1, 6:00 pm, Melanie Sommer melanie-som...@mailinator.com
wrote:
Problem solved. There was a typing error in the C model. Sorry!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
CakePHP group.
To
Hi,
I have models with belongsTo and hasMany relations in the following
form:
A - C - D - E
B - C
F - E
G - E
When displaying E I also want to display the title-fields of A, B, C,
D, F and G.
find() can only be set to rescursive=2 giving me E together with D, C,
F, G.
What is the best way of
Use ContainableBehavior and try the find() like:
$this-E-find(
'all',
array(
'contain' = array(
'D' = array(
'fields' = array('D.title'),
'C' = array(