PHP 클래스 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.
부터: 3.0
저자: Qiang Xue ([email protected])
상속: extends TBaseValidator
파일 보기 프로젝트 열기: pradosoft/prado

공개 메소드들

메소드 설명
evaluateIsValid ( ) : boolean This method overrides the parent's implementation.
getControlToCompare ( ) : string
getDataType ( ) : TValidationDataType
getDateFormat ( ) : string
getOperator ( ) : TValidationCompareOperator
getValueToCompare ( ) : string
setControlToCompare ( $value ) Sets the input component to compare with the input control being validated.
setDataType ( $value ) Sets the data type that the values being compared are converted to before the comparison is made.
setDateFormat ( $value ) Sets the date format for a date validation
setOperator ( $value ) Sets the comparison operation to perform
setValueToCompare ( $value ) Sets the constant value to compare with the value entered by the user into the input component being validated.

보호된 메소드들

메소드 설명
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.
getComparisonValues ( $value1, $value2 ) : array Parse the pair of values into the appropriate value type.

메소드 상세

evaluateIsValid() 공개 메소드

The validation succeeds if the input data compares successfully. The validation always succeeds if ControlToValidate is not specified or the input data is empty.
public evaluateIsValid ( ) : boolean
리턴 boolean whether the validation succeeds

getClientClassName() 보호된 메소드

This method overrides the parent implementation.
protected getClientClassName ( ) : string
리턴 string the javascript class name

getClientScriptOptions() 보호된 메소드

Returns an array of javascript validator options.
protected getClientScriptOptions ( ) : array
리턴 array javascript validator options.

getComparisonValues() 보호된 메소드

Parse the pair of values into the appropriate value type.
protected getComparisonValues ( $value1, $value2 ) : array
리턴 array appropriate type of the value pair, array($value1, $value2);

getControlToCompare() 공개 메소드

public getControlToCompare ( ) : string
리턴 string the input component to compare with the input control being validated.

getDataType() 공개 메소드

public getDataType ( ) : TValidationDataType
리턴 TValidationDataType the data type that the values being compared are converted to before the comparison is made. Defaults to TValidationDataType::String.

getDateFormat() 공개 메소드

public getDateFormat ( ) : string
리턴 string the date validation date format if any

getOperator() 공개 메소드

public getOperator ( ) : TValidationCompareOperator
리턴 TValidationCompareOperator the comparison operation to perform. Defaults to TValidationCompareOperator::Equal.

getValueToCompare() 공개 메소드

public getValueToCompare ( ) : string
리턴 string the constant value to compare with the value entered by the user into the input component being validated.

setControlToCompare() 공개 메소드

Sets the input component to compare with the input control being validated.
public setControlToCompare ( $value )

setDataType() 공개 메소드

Sets the data type that the values being compared are converted to before the comparison is made.
public setDataType ( $value )

setDateFormat() 공개 메소드

Sets the date format for a date validation
public setDateFormat ( $value )

setOperator() 공개 메소드

Sets the comparison operation to perform
public setOperator ( $value )

setValueToCompare() 공개 메소드

Sets the constant value to compare with the value entered by the user into the input component being validated.
public setValueToCompare ( $value )