Models: Node, Customer, Offer
Node belongsto Customer
Offer belongsto "Receiver" (Node)
Offer belongsto "Sender" (Node) (..irrelevant, but just to justify
why I use an alias)
The situation is: I have an offer that points to a receiver (node),
and that receiver's customer_id is 0 (created a dummy customer to
represent "non-existant" record for a non-redeemed offer)
I have an ajax->form that POSTs to offers/redeem where I want to
create a new customer record and update the receiver's customer_id to
that new customer.
when i get to offer/redeem
$this->data = { customer => {name=>john, email=>[email protected]},
receiver=>{id=1005}, offer=>{id=>1} }
and i do $this->Offer->Receiver->Customer->save($this->data)
This creates a new customer, but doesn't update the receiving node's
customer_id
if i do $this->Offer->Receiver->save($this->data) it does neither.
Can I do these both in one shot? Or create customer first, then update
node after? I've read the manual's pages on how to save() several
times but can't figure it out.
In either case, what should $this->data be formatted like and what
should be invoking save()?
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---