I have updatebypk
in my controller to update a Model but i found that updatebypk
not calling Yii afterSave
function.It is the behaviour of updatebypk
Model::updateByPk($key,array('content'=>$content))// it is updating conten
Model.php
protected function afterSave()
{
parent::afterSave();
if(!$this->isNewRecord){
$this->update_time = time();
$this->update_by = Yii::app()->user->getId();
$this->save(false);
}
}