PHP Class Prado\Web\UI\WebControls\TCompareValidator
TCompareValidator compares the value entered by the user into an input
control with the value entered into another input control or a constant value.
To compare the associated input control with another input control,
set the {@link setControlToCompare ControlToCompare} property to the ID path
of the control to compare with. To compare the associated input control with
a constant value, specify the constant value to compare with by setting the
{@link setValueToCompare ValueToCompare} property.
The {@link setDataType DataType} property is used to specify the data type
of both comparison values. Both values are automatically converted to this data
type before the comparison operation is performed. The following value types are supported:
-
Integer A 32-bit signed integer data type.
-
Float A double-precision floating point number data type.
-
Date A date data type. The format can be specified by the
{@link setDateFormat DateFormat} property
-
String A string data type.
Use the {@link setOperator Operator} property to specify the type of comparison
to perform. Valid operators include Equal, NotEqual, GreaterThan, GreaterThanEqual,
LessThan and LessThanEqual.
Show file
Open project: pradosoft/prado
Public Methods
Protected Methods
Method Details
evaluateIsValid()
public method
The validation succeeds if the input data compares successfully.
The validation always succeeds if ControlToValidate is not specified
or the input data is empty.
getClientClassName()
protected method
This method overrides the parent implementation.
getClientScriptOptions()
protected method
Returns an array of javascript validator options.
getComparisonValues()
protected method
Parse the pair of values into the appropriate value type.
getControlToCompare()
public method
getDataType()
public method
public getDataType ( ) : TValidationDataType |
return |
TValidationDataType |
the data type that the values being compared are converted to before the comparison is made. Defaults to TValidationDataType::String. |
getOperator()
public method
public getOperator ( ) : TValidationCompareOperator |
return |
TValidationCompareOperator |
the comparison operation to perform. Defaults to TValidationCompareOperator::Equal. |
getValueToCompare()
public method
public getValueToCompare ( ) : string |
return |
string |
the constant value to compare with the value entered by the user into the input component being validated. |
setControlToCompare()
public method
Sets the input component to compare with the input control being validated.
setDataType()
public method
Sets the data type that the values being
compared are converted to before the comparison is made.
setOperator()
public method
Sets the comparison operation to perform
setValueToCompare()
public method
Sets the constant value to compare with the value entered by the user into the input component being validated.