PHP Класс Prado\Web\UI\WebControls\TDataTypeValidator

TDataTypeValidator verifies if the input data is of the type specified by {@link setDataType DataType}. The following data 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. - String A string data type. For Date type, the property {@link setDateFormat DateFormat} will be used to determine how to parse the date string. If it is not provided, the string will be assumed to be in GNU datetime format.
С версии: 3.0
Наследование: extends TBaseValidator
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
evaluateIsValid ( ) : boolean This method overrides the parent's implementation.
getDataType ( ) : TValidationDataType
getDateFormat ( ) : string
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

Защищенные методы

Метод Описание
evaluateDataTypeCheck ( $value ) : boolean Determine if the given value is of a particular type using RegExp.
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.

Описание методов

evaluateDataTypeCheck() защищенный Метод

Determine if the given value is of a particular type using RegExp.
protected evaluateDataTypeCheck ( $value ) : boolean
Результат boolean true if value fits the type expression.

evaluateIsValid() публичный Метод

The validation succeeds if the input data is of valid type. 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.

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

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 )