You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
features : validateOrFail() new method to validate and if it fails it will throw a ValidationException. Also if the target is an object, the object is returned. If the target is a struct, the struct is returned ONLY with the validated fields.
Copy file name to clipboardExpand all lines: changelog.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,13 @@
2
2
3
3
## 1.5.0
4
4
5
-
*`feature` : `valiateModel()` is now deprecated in favor of `validate()`. `validateModel()` is now marked for deprecation.
5
+
*`features` : `validateOrFail()` new method to validate and if it fails it will throw a `ValidationException`. Also if the target is an object, the object is returned. If the target is a struct, the struct is returned ONLY with the validated fields.
6
+
*`feature` : `validateModel()` is now deprecated in favor of `validate()`. `validateModel()` is now marked for deprecation.
6
7
*`improvement` : Direct scoping for performance an avoidance of lookup bugs
7
8
*`improvement` : HTTPS protocol for everything
8
9
*`improvement` : Updated to testbox 3
9
-
*`bug` : Fix mapping declaration for apidocs
10
+
*`bug` : Fix mapping declaration for apidocs`
11
+
*`bug` : Missing return on `addSharedConstraint()` function
@@ -87,15 +87,17 @@ component accessors="true" serialize="false" implements="IValidationManager" sin
87
87
}
88
88
89
89
/**
90
-
* Validate an object using constraints
91
-
*
92
-
* @target The target object to validate or a structure like a form or collection. If it is a collection, we will build a generic object for you so we can validate the structure of name-value pairs.
93
-
* @fields One or more fields to validate on, by default it validates all fields in the constraints. This can be a simple list or an array.
94
-
* @constraints An optional shared constraints name or an actual structure of constraints to validate on.
95
-
* @locale An optional locale to use for i18n messages
96
-
* @excludeFields An optional list of fields to exclude from the validation.
97
-
* @IncludeFields An optional list of fields to include in the validation.
98
-
*/
90
+
* Validate an object using constraints
91
+
*
92
+
* @target The target object to validate or a structure like a form or collection. If it is a collection, we will build a generic object for you so we can validate the structure of name-value pairs.
93
+
* @fields One or more fields to validate on, by default it validates all fields in the constraints. This can be a simple list or an array.
94
+
* @constraints An optional shared constraints name or an actual structure of constraints to validate on.
95
+
* @locale An optional locale to use for i18n messages
96
+
* @excludeFields An optional list of fields to exclude from the validation.
97
+
* @IncludeFields An optional list of fields to include in the validation.
98
+
*
99
+
* @return Results object
100
+
*/
99
101
IValidationResultfunctionvalidate(
100
102
requiredanytarget,
101
103
stringfields="*",
@@ -122,13 +124,15 @@ component accessors="true" serialize="false" implements="IValidationManager" sin
@@ -154,13 +164,56 @@ component accessors="true" serialize="false" implements="IValidationManager" sin
154
164
}
155
165
156
166
/**
157
-
* Process validation rules on a target object and field
158
-
*
159
-
* @results The validation result object
160
-
* @rules The structure containing validation rules
161
-
* @target The target object to do validation on
162
-
* @field The field to validate
163
-
*/
167
+
* Validate an object using constraints and throw a `ValidationException` if the validation fails
168
+
169
+
* @target The target object to validate or a structure like a form or collection. If it is a collection, we will build a generic object for you so we can validate the structure of name-value pairs.
170
+
* @fields One or more fields to validate on, by default it validates all fields in the constraints. This can be a simple list or an array.
171
+
* @constraints An optional shared constraints name or an actual structure of constraints to validate on.
172
+
* @locale An optional locale to use for i18n messages
173
+
* @excludeFields An optional list of fields to exclude from the validation.
174
+
* @IncludeFields An optional list of fields to include in the validation.
175
+
*
176
+
* @throws ValidationException
177
+
* @return any,struct: The target object that was validated, or the structure fields that where validated.
0 commit comments