Saturday, October 23, 2010

Associations - How deep is too deep?

Nested associations - How deep is too deep?

I'm still struggeling a bit with associations, i'm wondering if there
is a limit in cakes automagic functionality. One level works fine, ie
for example

ModelA
hasMany
ModelB

Sending forms and saving everything using saveAll works fine. However,
if i add another level:


ModelA
hasMany
ModelB
hasMany
ModelC

It starts getting problematic. First of all, when adding data for
ModelC in the form like this (not sure whether this is correct at
all):

ModelB.0.ModelC.0.field

cakes security layer won't accept the form at all, it ends up in an
404 blackhole. After disabling the security check the data was passed
fine, but it isn't saved. So my question is whether there is a limit
to the automagic functionality, is one level of nesting the maximum it
can handle? Do i need to save the additional data manually?

Regards

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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 group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate