Как изменить значение $ model-> attribute в контроллере - Yii
Код UserMasterController:
<code>public function actionUpdate($id){ $model=$this->loadModel($id); if(isset($_POST['UserMaster'])){ $model->attributes=$_POST['UserMaster']; $model->attributes['emailsent'] = 'N'; if($model->save()) $this->redirect(array('admin')); } $this->render('update',array( 'model'=>$model, )); } </code>
строка, которая дает мне ошибку:$model->attributes['emailsent'] = 'N';
ERROR : Indirect modification of overloaded property UserMaster::$attributes
has no effect
Как я могу изменить значение атрибута? Я просто хочу установить это как'Y'
или же'N'
согласно условию