Zikula: A Flexible Open Source Content Management System
home | forum | international support | contact us

Docs For Class ValidationUtil

Class: ValidationUtil

Source Location: /pnobjlib/ValidationUtil.class.php

Class Overview


ValidationUtil

Methods


Inherited Variables

Inherited Methods


Class Details

[line 19] ValidationUtil



[ Top ]

Class Methods


method validateField [line 34]

A validateField( objectType $objectType, object The $object, field $field, required $required, cmp_op $cmp_op, cmp_value $cmp_value, err_msg $err_msg)

Validate a specific field using the supplied control parameters



Tags:

return:  true/false value indicating whether the field validation passed or failed


Parameters:

objectType   $objectType   The string object type
object The   $object   object to validate
field   $field   The field to validate
required   $required   whether or not the field is required
cmp_op   $cmp_op   The compare operation to perform
cmp_value   $cmp_value   The value to compare the supplied field value to. If the value starts with a ':', the argument is used as an object access key.
err_msg   $err_msg   The error message to use if the validation fails

[ Top ]

method validateFieldByArray [line 150]

A validateFieldByArray( object The $object, validationControl $validationControl)

Validate a specific field using the supplied control parameters



Tags:

return:  true/false value indicating whether the field validation passed or failed


Parameters:

object The   $object   object to validate
validationControl   $validationControl  

The structured validation control array

The expected structure for the validation array is as follows: $validationControl[] = array ('field' => $fieldname, 'required' => true/false, 'cmp_op' => eq/neq/lt/lte/gt/gte/url/email/valuearray/noop, 'cmp_value' => $value 'err_msg' => $errorMessage);

The noop value for the cmp_op field is only valid if the field is not required


[ Top ]

method validateObject [line 181]

A validateObject( objectType $objectType, object The $object, validationControls $validationControls)

Validate a specific field using the supplied control parameters



Tags:

return:  true/false value indicating whether the object validation passed or resulted in errors.


Parameters:

objectType   $objectType   The string object type
object The   $object   object to validate
validationControls   $validationControls  

The array of structured validation control arrays

The expected structure for the validation array is as follows: $validationControls[] = array ('field' => $fieldname, 'required' => true/false, 'cmp_op' => eq/neq/lt/lte/gt/gte/noop, 'cmp_value' => $value 'err_msg' => $errorMessage), ...);

The noop value for the cmp_op field is only valid if the field is not required


[ Top ]

method validateObjectPlain [line 216]

A validateObjectPlain( objectType $objectType, object The $object, validationArray $validationArray)

Validate a specific field using the supplied plain validation array. This function converts the plain validation array into a structured validation array and then calls ValidationUtil::validateObject().



Tags:

return:  true/false value indicating whether the object validation passed or failed


Parameters:

objectType   $objectType   The string object type
object The   $object   object to validate
validationArray   $validationArray  

The plain (numerically indexed) validation array

The expected structure for the validation array is as follows: $validationArray[] = array ($fieldname, true/false, eq/neq/lt/lte/gt/gte/noop, $value, $errorMessage);

The noop value for the cmp_op field is only valid if the field is not required


[ Top ]

Packages:

Files:

Classes: