\ValidationLogicCriteria
- Author: <shea@silverstripe.com.au> Credit to Uncle Cheese for the recipe
- License: BSD License http://www.silverstripe.org/bsd-license
Synopsis
class ValidationLogicCriteria
{
- // members
- protected $master = NULL;
- protected FormField $slave = NULL;
- protected ValidationLogicCriteria $parent = NULL;
- protected array $criteria = ;
- protected $logicalOperator = NULL;
- private static $comparisons;
- // methods
- public void __construct()
- public ValidationLogicCriteria __call()
- public ValidationLogicCriteria isBetween()
- public ValidationLogicCriteria andIf()
- public ValidationLogicCriteria orIf()
- public void addCriterion()
- public array getCriteria()
- public string getLogicalOperator()
- public ValidationLogicCriteria group()
- public FormField end()
- public string|bool phpEvalString()
- public string toScript()
- public string getMasterList()
Hierarchy
Uses
- SilverStripe\Core\Config\Configurable
- SilverStripe\Core\Injector\Injectable
Tasks
Line | Task |
---|---|
196 | fix this |
Members
private
- $comparisons — array
protected
- $criteria
—
array
A list of {@link ValidationLogicCriterion} objects - $logicalOperator
—
string
Either "and" or "or", determines disjunctive or conjunctive logic for the whole criteria set - $master
—
string
The name of the form field that depends on the criteria - $parent
—
ValidationLogicCriteria
A parent {@link ValidationLogicCriteria}, for grouping - $slave
—
SilverStripe\Forms\FormField
The form field that responds to the state of {@link $master}
Methods
public
- __construct()
- __call() — Wildcard method for applying all the possible conditions
- addCriterion() — Adds a new criterion
- andIf() — Adds a new criterion, and makes this set use conjuctive logic
- end() — Ends the chaining and returns the parent {@link FormField} object
- getCriteria() — Gets all the criteria
- getLogicalOperator() — Gets a Javascript symbol for the logical operator
- getMasterList() — Gets a list of all the master fields in this criteria set
- group() — Creates a nested {@link ValidationLogicCriteria}
- isBetween() — Adds a {@link ValidationLogicCriterion} for a range of values
- orIf() — Adds a new criterion, and makes this set use disjunctive logic
- phpEvalString()
- toScript() — Creates a JavaScript readable representation of the logic