Class Validation
Data validation class helper
Located in /class.validation.php (line 22)
Clears any errors in the error list
Returns whether or not the specified field has any errors noted through validation calls
- string $sField: The name of the field to check for errors on
Returns the list of errors generated through validation calls. Returns in the format of:
Array(
field1 => array(
0 => "field1 must be between 2 and 32 characters",
1 => "field1 is not between valid email address"
),
field2 => array(
0 => "field2 is required"
)
)
Returns whether or not any errors were noted through validation calls
Stores the supplied error in the static error list
- string $sKey: The name of the form field the error occurred on
- string $sError: The error message
- $sName
- $sValue
- $sMessage
- $sName
- $sValue
- $sMessage
Validates that the supplied data is a valid American Express credit card number.
If validation fails, an error message is added to the list of errors.
- string $sName: The name of the field being validated
- string $sValue: The data to validate against
- string $sMessages: Optional; the message to store in the list of validation errors if validation fails. Default: ""
- $sMessage
Validates that a supplied value matches the supplied regular expression. If validation fails, an error message is added to the list of errors.
- string $sName: The name of the field being validated
- string $sValue: The data to validate against
- string $sExpr: The regular expression to match against the supplied data
- string $sMessage: The message to store in the list of validation errors if validation fails
Validates that the supplied date is a validate date. Date can be in the following formats:
MM/DD/YYYY MM-DD-YYYY YYYYMMDD
If validation fails, an error message is added to the list of errors.
- string $sName: The name of the field being validated
- string $sValue: The data to validate against
- string $sMessage: Optional; the message to store in the list of validation errors if validation fails. Default: ""
First validates that sValue and sMatch are validate dates using the ValidateDate() method. If these checks pass, this method then validates that sMatch is greater than sValue.
- string $sName: The name of the field being validated
- string $sDate: The data to validate against
- string $sMatch: The date to compare against
- string $sMessages: The message to store in the list of validation errors if validation fails
- $sMessage
Validates that the supplied data is a valid Discover credit card number.
If validation fails, an error message is added to the list of errors.
- string $sName: The name of the field being validated
- string $sValue: The data to validate against
- string $sMessages: Optional; the message to store in the list of validation errors if validation fails. Default: ""
- $sMessage
Validates that the supplied value is a valid domain name.
If validation fails, an error message is added to the list of errors.
- string $sName: The name of the field being validated
- string $sValue: The data to validate against
- string $sMessages: Optional; the message to store in the list of validation errors if validation fails. Default: ""
- $sMessage
- $sName
- $sValue
- $sMessage
Validates that the two supplied values are equal. This method is case insensistive, and also compares the trimmed values. If validation fails, an error message is added to the list of errors.
- string $sName: The name of the field being validated
- string $sValue: The value of the field being validated
- string $sMatchValue: The value of the field being compared
- string $sMessage: Optional, the message to store in the list of validation errors if validation fails
Validates that the size of an uploaded file does not exceed a certain file size. If validation fails, an error message is added to the list of errors.
- string $sName: The name of the file field to validate
- integer $iSizeInBytes: The maximum size the file is allowed to be
- string $sMessage: Optional; the message to store in the list of validation errors if validation fails. Default: ""
Validates that an uploaded file is one of the supplied mime types. If FileInfo extension is not installed, this method relies on the mime type sent by the browser, and this type cannot be trusted, or may not even be present. OpenAvanti recommends installing FileInfo.
If validation fails, an error message is added to the list of errors.
- string $sName: The name of the file field to validate
- string $sTmpFileName: The name of the uploaded temporary file
- array $aMimeTypes: An array of file extensions that are valid for the uploaded file
- string $sMessage: Optional; the message to store in the list of validation errors if validation fails. Default: ""
Validates that a file was uploaded based on the name of the file field. If validation fails, an error message is added to the list of errors.
- string $sName: The name of the file field to validate
- string $sMessage: Optional; the message to store in the list of validation errors if validation fails
Validates that the supplied data is a valid integer. If not, an error message is added to the list of errors.
- string $sName: The name of the field being validated
- string $sValue: The data to validate against
- string $sMessage: Optional; the message to store in the list of validation errors if validation fails
Validates that the supplied value's length is between the supplied minimum and maximum range. This method DOES NOT determine whether the value is in the range, but the number characters in the value is in the supplied range. This method trims the data before validating. If not, an error message is added to the list of errors.
- string $sName: The name of the field being validated
- string $sValue: The data to validate against
- integer $fMin: The minimum number of characters the supplied data must be in length to pass validation
- integer $fMax: The maximum number of characters the supplied data must not surpass in length to pass validation
- string $sMessage: Optional; the message to store in the list of validation errors if validation fails. Default: ""
Validates that the supplied data is a Luhn number
If validation fails, an error message is added to the list of errors.
- string $sName: The name of the field being validated
- string $sValue: The data to validate against
- string $sMessages: Optional; the message to store in the list of validation errors if validation fails. Default: ""
- $sMessage
Validates that the supplied data is a valid MasterCard credit card number.
If validation fails, an error message is added to the list of errors.
- string $sName: The name of the field being validated
- string $sValue: The data to validate against
- string $sMessages: Optional; the message to store in the list of validation errors if validation fails. Default: ""
- $sMessage
Validates that the supplied data is not greater than iMax characters in length. This method trims the data before validating. If not, an error message is added to the list of errors.
- string $sName: The name of the field being validated
- string $sValue: The data to validate against
- integer $iMax: The maximum number of characters the supplied data must not surpass in length to pass validation
- string $sMessage: Optional; the message to store in the list of validation errors if validation fails. Default: ""
Validates that the supplied data is at least iMin characters in length. This method trims the data before validating. If not, an error message is added to the list of errors.
- string $sName: The name of the field being validated
- string $sValue: The data to validate against
- integer $iMin: The minimum number of characters the supplied data must be in length to pass validation
- string $sMessage: Optional; the message to store in the list of validation errors if validation fails. Default: ""
Validates that the supplied data is a valid numeric value. If not, an error message is added to the list of errors.
- string $sName: The name of the field being validated
- string $sValue: The data to validate against
- string $sMessage: Optional; the message to store in the list of validation errors if validation fails
Validates that the supplied value is not empty. If not, an error message is added to the list of errors.
- string $sName: The name of the field being validated
- string $sValue: The data to validate against
- string $sMessage: Optional, the message to store in the list of validation errors if validation fails
Validates that the supplied time value is a validate time. This method basically validates that there are two integer values separated by a colon. Seconds and any AM/PM notation are stripped off. The first integer (hours) value must be between 1 and 23, and the second integer value (minutes) must be between 0 and 59.
If validation fails, an error message is added to the list of errors.
- string $sName: The name of the field being validated
- string $sValue: The data to validate against
- string $sMessages: Optional; the message to store in the list of validation errors if validation fails. Default: ""
- $sMessage
Validates that the supplied data is a valid Visa credit card number.
If validation fails, an error message is added to the list of errors.
- string $sName: The name of the field being validated
- string $sValue: The data to validate against
- string $sMessages: Optional; the message to store in the list of validation errors if validation fails. Default: ""
- $sMessage
- $sName
- $sValue
- $sMessage
Documentation generated on Thu, 25 Feb 2010 15:59:42 -0500 by phpDocumentor 1.4.3

