i want to copy data after savning in one model to 2nd model
my code snippets as directed by some members but not working.
plz update this code .
thanks
my code snippets as directed by some members but not working.
protected function afterSave() //Copy data from Client to packageassignment *** assuming your you're in the Client model
//and Client has id,package_id,p_start_date
{
$packageassignment= new Packageassignment();
$packageassignment->user_id=$this->id;
$packageassignment->package_id=$this->package_id;
$packageassignment->package_start_date=$this->p_start_date;
$packageassignment->save();
return parent::afterSave();
}
plz update this code .
thanks