PHP Class ValidationLogicCriteria, silverstripe-zenvalidator

Inheritance: extends Object
ファイルを表示 Open project: sheadawson/silverstripe-zenvalidator Class Usage Examples

Protected Properties

Property 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}

Public Methods

Method 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 method

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

__construct() public method

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 method

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

andIf() public method

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

end() public method

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

getCriteria() public method

Gets all the criteria
public getCriteria ( ) : array
return array

getLogicalOperator() public method

Gets a Javascript symbol for the logical operator
public getLogicalOperator ( ) : string
return string

getMasterList() public method

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

group() public method

Creates a nested {@link ValidationLogicCriteria}
public group ( ) : ValidationLogicCriteria
return ValidationLogicCriteria

orIf() public method

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

phpEvalString() public method

public phpEvalString ( ) : string
return string

toScript() public method

Creates a JavaScript readable representation of the logic
public toScript ( ) : string
return string

Property Details

$criteria protected_oe property

A list of {@link ValidationLogicCriterion} objects
protected array $criteria
return array

$logicalOperator protected_oe property

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

$master protected_oe property

The name of the form field that depends on the criteria
protected string $master
return string

$parent protected_oe property

A parent {@link ValidationLogicCriteria}, for grouping
protected ValidationLogicCriteria $parent
return ValidationLogicCriteria

$slave protected_oe property

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