Thursday, February 10, 2011

Re: HABTM w/ Multiple Select type Field and saveAll() on multiple records.

Hi,

If you use InnoDB tables in MySQL you can use a transaction:

http://deadlytechnology.com/web-development-tips/jquery-cakephp-tips/

This lets you define a for loop and do multiple save() calls on
different models and then commit if all went well or rollback on failure.

Regards,

Maurits

On 02/09/2011 11:10 PM, OldWest wrote:
>
> I wanted to know if you have much experience with saveAll() w/ HABTM on
> a multiple select field?
>
> I can get the Zips populated from the plans_zips table (with the below),
> but I cannot get the zips to save in the HABTM plans_zips table..
>
> ...
> *<?php echo $this->Form->input('"$i".Zip', array(*
> *'type' => 'select',*
> *'multiple' => 'true',*
> *'label' => 'Select the Zips'*
> *));*
> *?>*
> ...
>
> The $i represents the for loop I am using for the adding of multiple
> records.
>
> --
> 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


--
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