PHP Class ValidationLogicCriteria, silverstripe-zenvalidator

Inheritance: extends Object
Afficher le fichier Open project: sheadawson/silverstripe-zenvalidator Class Usage Examples

Protected Properties

Свойство Type Description
$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 FormField The form field that responds to the state of {@link $master}

Méthodes publiques

Méthode Description
__call ( sting $method, array $args ) : ValidationLogicCriteria Wildcard method for applying all the possible conditions
__construct ( FormField $slave, [type] $master, [type] $parent = null ) Constructor
addCriterion ( ValidationLogicCriterion $c ) Adds a new criterion
andIf ( string $master = null ) : ValidationLogicCriteria Adds a new criterion, and makes this set use conjuctive logic
end ( ) : FormField/ValidationLogicCriteria Ends the chaining and returns the parent object, either {@link ValidationLogicCriteria} or {@link FormField}
getCriteria ( ) : array Gets all the criteria
getLogicalOperator ( ) : string Gets a Javascript symbol for the logical operator
getMasterList ( ) : string Gets a list of all the master fields in this criteria set
group ( ) : ValidationLogicCriteria Creates a nested {@link ValidationLogicCriteria}
orIf ( string $master = null ) : ValidationLogicCriteria Adds a new criterion, and makes this set use disjunctive logic
phpEvalString ( ) : string
toScript ( ) : string Creates a JavaScript readable representation of the logic

Method Details

__call() public méthode

Wildcard method for applying all the possible conditions
public __call ( sting $method, array $args ) : ValidationLogicCriteria
$method sting The method name
$args array The arguments
Résultat ValidationLogicCriteria

__construct() public méthode

Constructor
public __construct ( FormField $slave, [type] $master, [type] $parent = null )
$slave FormField The form field that responds to changes of another form field
$master [type]
$parent [type]

addCriterion() public méthode

Adds a new criterion
public addCriterion ( ValidationLogicCriterion $c )
$c ValidationLogicCriterion

andIf() public méthode

Adds a new criterion, and makes this set use conjuctive logic
public andIf ( string $master = null ) : ValidationLogicCriteria
$master string The master form field
Résultat ValidationLogicCriteria

end() public méthode

Ends the chaining and returns the parent object, either {@link ValidationLogicCriteria} or {@link FormField}
public end ( ) : FormField/ValidationLogicCriteria
Résultat FormField/ValidationLogicCriteria

getCriteria() public méthode

Gets all the criteria
public getCriteria ( ) : array
Résultat array

getLogicalOperator() public méthode

Gets a Javascript symbol for the logical operator
public getLogicalOperator ( ) : string
Résultat string

getMasterList() public méthode

Gets a list of all the master fields in this criteria set
public getMasterList ( ) : string
Résultat string

group() public méthode

Creates a nested {@link ValidationLogicCriteria}
public group ( ) : ValidationLogicCriteria
Résultat ValidationLogicCriteria

orIf() public méthode

Adds a new criterion, and makes this set use disjunctive logic
public orIf ( string $master = null ) : ValidationLogicCriteria
$master string The master form field
Résultat ValidationLogicCriteria

phpEvalString() public méthode

public phpEvalString ( ) : string
Résultat string

toScript() public méthode

Creates a JavaScript readable representation of the logic
public toScript ( ) : string
Résultat string

Property Details

$criteria protected_oe property

A list of {@link ValidationLogicCriterion} objects
protected array $criteria
Résultat array

$logicalOperator protected_oe property

Either "and" or "or", determines disjunctive or conjunctive logic for the whole criteria set
protected string $logicalOperator
Résultat string

$master protected_oe property

The name of the form field that depends on the criteria
protected string $master
Résultat string

$parent protected_oe property

A parent {@link ValidationLogicCriteria}, for grouping
protected ValidationLogicCriteria $parent
Résultat ValidationLogicCriteria

$slave protected_oe property

The form field that responds to the state of {@link $master}
protected FormField $slave
Résultat FormField