for surveyInfo
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('fcode, survey_name, survey_details', 'required'),
array('survey_status', 'length', 'max'=>13),
array('fcode', 'length', 'max'=>13),
array('survey_name', 'length', 'max'=>100),
array('survey_details', 'length', 'max'=>200),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('survey_id, fcode, survey_name, survey_details, survey_status', 'safe', 'on'=>'search'),
);
}
and for surveyQuestions ::
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('survey_id, surveyQuestion_content, surveyQuestion_details', 'required'),
array('survey_id', 'numerical', 'integerOnly'=>true),
array('surveyQuestion_content', 'length', 'max'=>300),
array('surveyQuestion_details', 'length', 'max'=>200),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('surveyQuestion_id, survey_id, surveyQuestion_content, surveyQuestion_details', 'safe', 'on'=>'search'),
);
}
the pk in surveyinfo is :: survey_id.
is that it?