Wednesday, April 18, 2012

Help with saveAll

Ok I have 3 models: Users, Businesses, and Measures. These models are
related as follows:

Users hasMany Measures
Users hasMany Businesses
Businesses hasMany Measures
Measures belongsTo Users, Businesses
Businesses belongsTo Users

So basically I have a user registration form and I need some measures
to be associated to the business and some not to be associate to the
business (if a business exist). All measures are associated to the
user. So I have two ways that I've tried to do this and both produce
no errors, however, both do not give the desired results.

Method 1: http://bin.cakephp.org/view/884824868
-
>Problems: Creates 2 records however the second record is exactly
what I want. I need the business id in order to properly save the
measures that are suppose to be associated with the business

Method 2: http://bin.cakephp.org/view/244376883
-
>Produces no errors however it does not properly save data to the
business table or the measures table. Note however that you may be
able to better understand what I'm doing in this method.


Any help is very much appreciated.

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate