public function field($name, ValidationSet $set = null)
    {
        if (empty($this->_fields[$name])) {
            $set = $set ?: new ValidationSet();
            $this->_fields[$name] = $set;
        }

        return $this->_fields[$name];
    }
public function field($name, ValidationSet $set = null)
    {
        if (empty($this->_fields[$name])) {
            $set = $set ?: new ValidationSet();
            $this->_fields[$name] = $set;
        }

        return $this->_fields[$name];
    }
public function field ( $ name , ValidationSet $ set = null ) { if ( empty ( $ this -> _fields [ $ name ] ) ) { $ set = $ set ? : new ValidationSet ( ) ; $ this -> _fields [ $ name ] = $ set ; } return $ this -> _fields [ $ name ] ; }
Returns a ValidationSet object containing all validation rules for a field, if
passed a ValidationSet as second argument, it will replace any other rule set defined
before

@param string $name [optional] The fieldname to fetch.
@param \Cake\Validation\ValidationSet|null $set The set of rules for field
@return \Cake\Validation\ValidationSet
Returns a ValidationSet object containing all validation rules for a field if passed a ValidationSet as second argument it will replace any other rule set defined before