class staticbo.rules. RuleList
Source: rules/
Represents the lists of rules of a model instance.
Methods
new RuleList()
Creates a new rule list instance.
Methods
add(id, rule)
Adds a new rule to the list of rules of its owner property.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
id |
string |
|
The identifier of the rule list, typically the property name. |
rule |
|
A validation or authorization rule. |
- Throws
-
Argument error: The identifier must be a non-empty string.
-
Argument error: The rule must be a ValidationRule or AuthorizationRule object.
sort()
Sorts the lists of rules by rule priority.