new BrokenRuleList(modelName)
Creates a new broken rule list instance.
Parameters:
Name | Type | Description |
---|---|---|
modelName |
string | The name of the model. |
Throws:
Methods
-
add(brokenRule)
-
Adds a broken rule to the list.
Parameters:
Name Type Description brokenRule
bo.rules.BrokenRule A broken rule to add.
Throws:
Argument error: The rule must be a BrokenRule object. -
clear(property)
-
Removes the broken rules of a property except of the retained ones. If property is omitted, all broken rules are removed except of the retained ones.
Parameters:
Name Type Argument Description property
bo.rules.PropertyInfo <optional>
A property definition.
-
clearAll(property)
-
Removes the broken rules of a property, including retained ones. If property is omitted, all broken rules are removed.
Parameters:
Name Type Description property
-
isValid() → {boolean}
-
Determines if the model is valid. The model is valid when it has no broken rule with error severity.
Returns:
- True if the model is valid, otherwise false.
- Type
- boolean
-
output(namespace) → {bo.rules.BrokenRulesOutput}
-
Transforms the broken rules into a format that can be sent to the client.
Parameters:
Name Type Argument Description namespace
string <optional>
The namespace of the message keys when messages are localizable.
Throws:
Argument error: The namespace must be a string.Returns:
The response object to send.
-
<inner> clearFor(propertyName)
-
Removes the broken rules of a property except of the retained ones.
Parameters:
Name Type Description propertyName
string The name of the property that broken rules are deleted of.