Class ecdValidation

Description

Static validation functions.

This class provides static validation functions. Each of these functions checks for some properties in the fields it is fed. If the specified fields don't match these requirements, the function returns an error message. Otherwise, it returns false.

Located in /ecdValidation.inc.php (line 40)


	
			
Method Summary
if field_set (mixed $val)
array find_missing_fields (array $fields, [array $mandatory_fields = null])
string validate_email (string $field, [string $fieldname = null])
string validate_email_bluestar (mixed $field, [mixed $fieldname = null])
string validate_mandatory (array $fields, [array $mandatory_fields = null])
string validate_password (mixed $field, [mixed $confirm = null])
string validate_phone (mixed $region, mixed $main_1, mixed $main_2, [mixed $ext = null], [mixed $fieldname = null])
string validate_quantity (mixed $field, [mixed $max = null], mixed $min)
Methods
field_set (line 106)

check if the given value exists and is not empty

since we cannot use empty() (which returns true on zero), we need a more specific function.

  • return: value isset() and if it is different from ''
  • uses: isset()
if field_set (mixed $val)
find_missing_fields (line 79)

Check for missing fields.

Block-checks $all_fields, an associative array of $field => $value, for empty/unset values. Optionaly, a restricted list of fields might be provided in $mandatory_fields as a list

  • return: the list of the fields missing
array find_missing_fields (array $fields, [array $mandatory_fields = null])
  • array $fields: the fields => value array to check
  • array $mandatory_fields: the list of mandatory fields
validate_email (line 118)

Verify if a email is valid.

  • return: an error message or false if email is valid
string validate_email (string $field, [string $fieldname = null])
  • string $field: the email
  • string $fieldname: an optional fieldname to display in the error message
validate_email_bluestar (line 146)

Verifies if email $field is valid and that it is an email to somebody in bluestar.

  • return: an error message or false if email is valid
string validate_email_bluestar (mixed $field, [mixed $fieldname = null])
validate_mandatory (line 57)

Check if mandatory fields are present

Block-checks $all_fields, an associative array of $field => $value, for empty/unset values. Optionaly, a restricted list of fields might be provided in $mandatory_fields as an associative array of $field => $name.

  • return: error of first empty/unset field found, false otherwise
string validate_mandatory (array $fields, [array $mandatory_fields = null])
  • array $fields: the fields => value array to check
  • array $mandatory_fields: the list of mandatory fields
validate_password (line 184)

Verifies if the given password is ok. Optionaly, you might provide a confirmation password.

  • return: an error message or false if email is valid
string validate_password (mixed $field, [mixed $confirm = null])
validate_phone (line 165)

Verifies if the specified phone number is valid.

  • return: an error message or false if email is valid
string validate_phone (mixed $region, mixed $main_1, mixed $main_2, [mixed $ext = null], [mixed $fieldname = null])
validate_quantity (line 197)

Validates quantity for a product or openbox item. Optionaly, you might provide a max. quantity.

  • return: an error message or false if email is valid
string validate_quantity (mixed $field, [mixed $max = null], mixed $min)

Documentation generated on Tue, 11 Jan 2005 01:38:24 -0500 by phpDocumentor 1.3.0RC3