Auto Insert Another 2 Models in Yii

Add in the first Model,

public function beforeSave() {
$model2 = new StudentRegistration;
$model3 = new RegistrationDetail;

// data Model 2
$model2->save();
$this->idfrommodel1=$model->idmodel2; //copy id
}

Iklan