yiisoft/yii — Issue #466: cActiveRecord save and saveAttributes
Author: Stageline
Created: 2012-03-07 10:43:13+00:00
State: open

http://paste.pocoo.org/show/GVcKAyjVebolre6xepPx/

I thnik found bug in CArctiveRecord save method.

This code working fine without errors.

public function afterSave()
{
foreach($this->categories as $key=>$val)
{
Yii::app()->db->createCommand()->insert('users__categories', array('catid'=>$val,'uid'=>$this->id));
}
//Tmpreg::model()->deleteAllByAttributes(array('email'=>$this->email));
return parent::afterSave();
}