When I load the model record below, change one value and try to save it, I get errors for every field that is a bit(1) (the bFieldName fields in the model code below) stating "Field must be an integer."
$model = Student::model()->findByPk(123);
$model->FieldName = 'abc';
$model->save();
Model:
public function rules() {
return array(
array('strFirstName, strLastName, nUserID, strEmail, strPhone, dateCreated', 'required'),
array('nUserID, bPhoto, bRecordings, bActive, nBillingDays, nLockDays', 'numerical', 'integerOnly'=>true),
array('strFirstName, strLastName', 'length', 'max'=>16),
array('strEmail', 'length', 'max'=>255),
array('strPhone', 'length', 'max'=>10),
array('strDescription', 'length', 'max'=>1000),
array('strStudioName', 'length', 'max'=>64),
array('nTeacherID, strFirstName, strLastName, nUserID, strEmail, strPhone, bPhoto, bRecordings, bActive, dateCreated, strDescription, strStudioName, nBillingDays, nLockDays', 'safe', 'on'=>'search'),
);
}
If I look at what value these fields hold, they are empty.
Why doesn’t the model have the values stored in the database for these fields, like the other fields?
Thanks