UncleCheese\DisplayLogic\Criteria
Synopsis
class Criteria
{
- // constants
- const LOGIC_OR = 'or';
- const LOGIC_AND = 'and';
- // members
- protected $master = NULL;
- protected FormField $slave = NULL;
- protected Criteria $parent = NULL;
- protected array $criteria = ;
- protected $animation = NULL;
- protected $logicalOperator = NULL;
- // methods
- public static void set_default_animation()
- public void __construct()
- public Criteria __call()
- public Criteria isBetween()
- public Criteria andIf()
- public Criteria orIf()
- public void addCriterion()
- public array getCriteria()
- public string getLogicalOperator()
- public string getMaster()
- public $this setMaster()
- public Criteria group()
- public Criteria useAnimation()
- public string getAnimation()
- public FormField/Criteria end()
- public string toScript()
- public string getMasterList()
Hierarchy
Uses
- SilverStripe\Core\Extensible
- SilverStripe\Core\Injector\Injectable
- SilverStripe\Core\Config\Configurable
Constants
Name | Value |
---|---|
LOGIC_OR | 'or' |
LOGIC_AND | 'and' |
Members
protected
- $animation
—
string
The animation method to use - $criteria
—
array
A list of {@link Criterion} 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
—
UncleCheese\DisplayLogic\Criteria
A parent {@link Criteria}, for grouping - $slave
—
SilverStripe\Forms\FormField
The form field that responds to the state of {@link $master}
Methods
public
- __construct() — Constructor
- __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 object, either {@link Criteria} or {@link FormField}
- getAnimation() — Answers the animation method to use
- getCriteria() — Gets all the criteria
- getLogicalOperator() — Gets a Javascript symbol for the logical operator
- getMaster() — Accessor for the master field
- getMasterList() — Gets a list of all the master fields in this criteria set
- group() — Creates a nested {@link Criteria}
- isBetween() — Adds a {@link Criterion} for a range of values
- orIf() — Adds a new criterion, and makes this set use disjunctive logic
- setMaster()
- set_default_animation() — Changes the configured default animation method
- toScript() — Creates a JavaScript readable representation of the logic
- useAnimation() — Defines the animation method to use