TypeValidatorUse the static TypeValidator class to validate an associated array of parameters against a type definition map.
Located in /TypeValidator.php (line 37)
Convert the type of a variable if necessary.
Validate an associated array of parameters against a type definition map.
Normally, you don't need to call this function directly. Ist's called from every select(), insert(), update() and delete() function. See the IConnector interface.
A map is an array of type definitions. A type definition is an array with two or three elements. Format:
$map[] = array(name, type[, default]); name: The key of an element in the associated array to validate. type: A type identifier, see TypeValidator::$isType. default: An optional default value. Can be of any type, also null.
If the type of $param[name] is wrong and can't be converted to the required type, an exception is thrown. If $param[name] doesn't exist or is null, the optional default value is used or - if no default value is given - an exception is thrown. Exsample:
Checks if a type definition is valid. If not, an exception is thrown.
Check if an associated array of parameters match a type definition.
If not, an exception is thrown.
Valid parameters may be are converted or substituted to match the field definitien.
Check the type of a variable. A value of null allways returns false.
Documentation generated on Wed, 03 Jun 2009 12:41:56 +0200 by phpDocumentor 1.4.1