public function rules() { return array(array('code', 'required'), array('phone, contact_id', 'safe'), array('id, code', 'safe', 'on' => 'search')); }