More info needed as MI says. Based on whats available why not do it as
a beforeSave? Only one expensive write to your DB then.

function beforeSave()
{
  // assuming your data is in $this->data
  $this->data[MODELNAME]['total'] = $this->data[MODELNAME]['price'] *
$this->data[MODELNAME]['quantity'];

  // v important to do the return true otherwise the beforeSave fails.
  return true;
}

More on beforeSave in the manual

ian


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
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