Cadvancedarbehavior

I have a table created by a ratio of 2 other tables and the primary key of this table are the 2 ids, and I need to update or modify only that row.

But i dont know where to create the function or how to create it. I am trying Cadvancedarbehavior to do it.

Module:

[sub]public function relations()

{


	// NOTE: you may need to adjust the relation name and the related


	// class name for the relations automatically generated below.


	return array(


		'zfDocumentacionContratos' => array(self::HAS_MANY, 'ZfDocumentacionContrato', 'zf_contraros_zf_arrendatarios_arrendatario_id'),


		'zfDocumentacionContratos1' => array(self::HAS_MANY, 'ZfDocumentacionContrato', 'zf_contraros_zf_locales_local_id'),


	);


}[/sub]

Controller:

[sub]public function actionUpdate($id)

{


	$model=$this->loadModel($id);





	// Uncomment the following line if AJAX validation is needed


	// $this->performAjaxValidation($model);





	if(isset($_POST['ZfContratos']))


	{


		$model->attributes=$_POST['ZfContratos'];


		if($model->save())


			$this->redirect(array('view','id'=>$model->zf_arrendatarios_arrendatario_id));


	}





	$this->render('update',array(


		'model'=>$model,


	));


}[/sub]