public function rules() { // NOTE: you should only define rules for those attributes that // will receive user inputs. return array(array('risk_id', 'required'), array('id, event_id, risk_id', 'safe', 'on' => 'search')); }