So you have to change your strategy now: use updateAll as given below:
$this->Parent->recursive = -1; // free from all association
$this->Parent->updateAll(array('name'=>$myArray['Parent']['name']),
array('id'=>$myArray['Parent']['id']));
$lastId = $this->Parent->getLastInsertID();
Similarly with Child model
$this->Child->recursive = -1; // free from all association
$this->Child->updateAll(array('parent_id'=>$lastId),
array('id'=>$myArray['Child']['1']['id']));
if Child index has more than one array inside then
$updateCondtion = Set::classicExtract($myArray, 'Child.{n}.id');
$this->Child->updateAll(array('parent_id'=>$lastId),
array('id'=>$updateCondtion));
$myArray = {
"Parent" => {
"id" => "4",
"name" => "Parent"
},
"Child" => {
"1" => {
"parent_id" => "0",
"id" => "1"
}
}
}
Different approach altogether!