original_string: public function offsetSet($field, $rules)
      {
          if (!$rules instanceof ValidationSet) {
              $set = new ValidationSet();
              foreach ((array)$rules as $name => $rule) {
                  $set->add($name, $rule);
              }
          }
          $this->_fields[$field] = $rules;
      }
code: public function offsetSet($field, $rules)
      {
          if (!$rules instanceof ValidationSet) {
              $set = new ValidationSet();
              foreach ((array)$rules as $name => $rule) {
                  $set->add($name, $rule);
              }
          }
          $this->_fields[$field] = $rules;
      }
code_tokens: public function offsetSet ( $ field , $ rules ) { if ( ! $ rules instanceof ValidationSet ) { $ set = new ValidationSet ( ) ; foreach ( ( array ) $ rules as $ name => $ rule ) { $ set -> add ( $ name , $ rule ) ; } } $ this -> _fields [ $ field ] = $ rules ; }
docstring: Sets the rule set for a field
  
  @param string $field name of the field to set
  @param array|\Cake\Validation\ValidationSet $rules set of rules to apply to field
  @return void
docstring_tokens: Sets the rule set for a field