PHP Class Prado\Web\UI\WebControls\TListControlValidator

TListControlValidator checks the number of selection and their values for a TListControl that allows multiple selection. You can specify the minimum or maximum (or both) number of selections required using the {@link setMinSelection MinSelection} and {@link setMaxSelection MaxSelection} properties, respectively. In addition, you can specify a comma separated list of required selected values via the {@link setRequiredSelections RequiredSelections} property. Examples - At least two selections - "value1" must be selected and at least 1 other
Since: 3.0
Inheritance: extends TBaseValidator
Afficher le fichier Open project: pradosoft/prado

Méthodes publiques

Méthode Description
getMaxSelection ( ) : integer
getMinSelection ( ) : integer
getRequiredSelections ( ) : string Get a comma separated list of required selected values.
setMaxSelection ( $value )
setMinSelection ( $value )
setRequiredSelections ( $value ) Set the list of required values, using aa comma separated list.

Méthodes protégées

Méthode Description
evaluateIsValid ( ) : boolean This method overrides the parent's implementation.
getClientClassName ( ) : string Gets the name of the javascript class responsible for performing validation for this control.
getClientScriptOptions ( ) : array Returns an array of javascript validator options.
getRequiredValues ( ) : array
getSelection ( $control ) : array

Method Details

evaluateIsValid() protected méthode

The validation succeeds if the input component changes its data from the InitialValue or the input component is not given.
protected evaluateIsValid ( ) : boolean
Résultat boolean whether the validation succeeds

getClientClassName() protected méthode

This method overrides the parent implementation.
protected getClientClassName ( ) : string
Résultat string the javascript class name

getClientScriptOptions() protected méthode

Returns an array of javascript validator options.
protected getClientScriptOptions ( ) : array
Résultat array javascript validator options.

getMaxSelection() public méthode

public getMaxSelection ( ) : integer
Résultat integer max number of selections. Defaults to -1, meaning not set.

getMinSelection() public méthode

public getMinSelection ( ) : integer
Résultat integer min number of selections. Defaults to -1, meaning not set.

getRequiredSelections() public méthode

Get a comma separated list of required selected values.
public getRequiredSelections ( ) : string
Résultat string comma separated list of required values.

getRequiredValues() protected méthode

protected getRequiredValues ( ) : array
Résultat array list of required values.

getSelection() protected méthode

protected getSelection ( $control ) : array
Résultat array number of selected values and its values.

setMaxSelection() public méthode

public setMaxSelection ( $value )

setMinSelection() public méthode

public setMinSelection ( $value )

setRequiredSelections() public méthode

Set the list of required values, using aa comma separated list.
public setRequiredSelections ( $value )