Hi...
A bit explanations,
Let say i have 2 tables, with hasMany association
1. questions, and
2. answers, where it has foreignkey referred to question, question_id
This 2 tables ofcourse will turn to 2 models Question and Answer with
their association variables set-up.
1. Question has many answer so...in Question model $hasMany = array(
'Answer' => array( 'className' => 'Answer'));
2. Answer belongs to question so..in Answer module $belongsTo = array(
'Question' => array('className' => 'Question'));
Then, I have this array of data...both question and answer data. like
structure below:
Array{
[Question] => (
...................,
[Answer] => {
[0] =>(
...............),
[1]
=>(................),
}
)
}
My question is,
1. Can i save both Question and Answer records using
$this->Question->save() ONLY?
2. or do i have to do trigger 2 separate save $this->Question->save and
$this->Answer->save?
3. How can do this with transaction like begin, commit and rollback
trans?
regards
Amir
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---