Jak zmienić wartość $ model-> atrybuty w kontrolerze - Yii
UserMasterController Code:
<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>
linia, która daje mi błąd, to:$model->attributes['emailsent'] = 'N';
BŁĄD : Pośrednia modyfikacja przeciążonej właściwościUserMaster::$attributes
nie działa
Jak mogę zmienić wartość atrybutu? Chcę to tylko ustawić'Y'
lub'N'
jak na warunek