public static function checkUserInput($input, $fields = null, $ref = null, &$errCount = 0) {
		if( !isset($errCount) ) {
			$errCount = 0;
		}
		// Allow reversed parameters 2 & 3 - Declared as useless
		// 		if( !is_array($fields) && !is_object($ref) ) {
		// 			$tmp = $fields; $fields = $ref; $ref = $tmp; unset($tmp);
		// 		}
		// 		if( is_null($ref) && is_object($ref) ) {
		// 			$ref = $fields;
		// 			$fields = null;
		// 		}
		if( is_array(static::$validator) ) {
			if( $fields === null ) {
				$fields = static::$editableFields;
			}
			if( empty($fields) ) {
				return array();
			}
			$data = array();
			foreach( $fields as $field ) {
				// If editing the id field
				if( $field == static::$IDFIELD ) {
					continue;
				}
				$value = $notset = null;
				try {
					try {
						// Field to validate
						if( !empty(static::$validator[$field]) ) {
							$checkMeth = static::$validator[$field];
							// If not defined, we just get the value without check
							$value = static::$checkMeth($input, $ref);
							
							// Field to NOT validate
						} else if( array_key_exists($field, $input) ) {
							$value = $input[$field];
						} else {
							$notset = 1;
						}
						if( !isset($notset) &&
							($ref === null || $value != $ref->$field) &&
							($fields === null || in_array($field, $fields))
						) {
							$data[$field] = $value;
						}
						
					} catch( UserException $e ) {
						if( $value === null && isset($input[$field]) ) {
							$value = $input[$field];
						}
						throw InvalidFieldException::from($e, $field, $value);
					}
					
				} catch( InvalidFieldException $e ) {
					$errCount++;
					reportError($e, static::getDomain());
				}
			}
			return $data;
			
		} else if( is_object(static::$validator) ) {
			if( method_exists(static::$validator, 'validate') ) {
				return static::$validator->validate($input, $fields, $ref, $errCount);
			}
		}
		return array();
	}