Validate email addresses.
static
boolean
validateEmail
(mixed &$value, boolean &$edited, array &$errors)
-
mixed
&$value: A reference to value to check. Passed by reference so that the implementation can normalize the data.
-
boolean
&$edited: A reference to a boolean. This value will always be FALSE when the method is called. If the implementation edits the $value, set to TRUE.
-
array
&$errors: An array of WFError objects describing the error. The array is empty by default; you can add new error entries.
Validate a phone number.
Pretty flexible; allows any character(s) as separators. Just tries to be sure that there are the right number of digits in the right number of groups.
Doesn't allow extensions.
static
boolean
validatePhone
(mixed &$value, boolean &$edited, array &$errors, string $country)
-
mixed
&$value: A reference to value to check. Passed by reference so that the implementation can normalize the data.
-
boolean
&$edited: A reference to a boolean. This value will always be FALSE when the method is called. If the implementation edits the $value, set to TRUE.
-
array
&$errors: An array of WFError objects describing the error. The array is empty by default; you can add new error entries.
-
string
$country: The country code you want to use for validation. Example: "US". Presently only US codes are supported. All other countries will cause the value to be assumed valid.
Validate a postal code.
static
boolean
validatePostalCode
(mixed &$value, boolean &$edited, array &$errors, string $country)
-
mixed
&$value: A reference to value to check. Passed by reference so that the implementation can normalize the data.
-
boolean
&$edited: A reference to a boolean. This value will always be FALSE when the method is called. If the implementation edits the $value, set to TRUE.
-
array
&$errors: An array of WFError objects describing the error. The array is empty by default; you can add new error entries.
-
string
$country: The country code you want to use for validation. Example: "US". Presently only US codes are supported. All other countries will cause the value to be assumed valid.
Inherited Methods
Inherited From WFObject
WFObject::__construct()
WFObject::exposedProperties()
WFObject::getClass()
WFObject::keyPathToTargetAndKey()
WFObject::setValueForKey()
WFObject::setValueForKeyPath()
WFObject::validateValueForKey()
WFObject::validateValueForKeyPath()
WFObject::valueForKey()
WFObject::valueForKeyPath()
WFObject::valueForUndefinedKey()
WFObject::__toString()