To ease the building of the rules array.
Holds the rules under construction.
Creates and returns an instance.
Returns: RulesBuilder the new instance
Adds a rule to the set. This function takes a variable amount of parameters in order to cover the rule parameters. Example for a rule without parameter: addRule(‘myField’, ‘required’) Example for a rule with two parameters: addRule(‘myField’, ‘between’, 3, 7)
- $field (string) – the field for the rule
- $rule (string) – the rule to add
RulesBuilder the instance of the called RulesBuilder in order to chain the rules creation
Gets the created rules.
Returns: array the created rules