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;
    }
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;
    }
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 ; }
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
Sets the rule set for a field