Adding Rules for required alternate fields

Hello All,

I have a problem with model class, actually rules applying inside. The problem is How to add rules for alternate required fields to check one of the required fields is not empty.

Please see my Model method rules




public function rules() {

	// NOTE: you should only define rules for those attributes that

	// will receive user inputs.

	return array(

    	array('designation_applied, name, email, phone, preferred_location, relevant_skills, total_experience, uploaded_resume, alternate_resume', 'required'),

    	array('total_experience', 'numerical'),

    	array('designation_applied, preferred_location', 'length', 'max' => 11),

    	array('name, email', 'length', 'max' => 108),

    	array('phone', 'length', 'max' => 14),

    	array('relevant_skills, uploaded_resume', 'length', 'max' => 160),

    	array('email', 'email'),

    	array('phone', 'numerical', 'integerOnly' => true, 'message' => 'Please use only numeric value for phone number'),

    	array('verifyCode', 'captcha', 'allowEmpty' => !CCaptcha::checkRequirements()),

    	// The following rule is used by search().

    	// Please remove those attributes that should not be searched.

    	array('id, designation_applied, name, email, phone, preferred_location, relevant_skills, total_experience, date_time, uploaded_resume, alternate_resume', 'safe', 'on' => 'search'),

	);

}



"uploaded_resume" and "alternate_resume" these are two fields. User will be provide "uploaded_resume" either "alternate_resume".

Please help to do that

Thanks in Advance

Did you find a solution?