I have a scenario where I want to update multiple records
simultaneously. In this case, I have a form with check boxes next to
ids from the table I want to update. These are aliquots stored in a
lab.

updateAll seems like a natural solution, except I can't quite get my
head around defining the proper conditions. In my case the controller
receives an array of aliquot ids and one box id where they will all be
store.

$this->data['Aliquot']['id'][] // an array of selected ids sent from
my form
$this->data['Aliquot']['box_id'] // the id of the box we're going to
store the aliquots in

How would you define the conditions in updateAll() so that all of the
sent aliquot ids get the same box id?

$this->Aliquot->updateAll(array('Aliquot.box_id' => $this->data
['Aliquot']['box_id']));

Will the above syntax automagically update all of the aliquot records
with the same box id if I don't define conditions?
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to