Class X2Validator
Miscellaneous additions to CValidator including option to have errors reported in the form of exceptions. Certain bad inputs will not occur during normal form submission and indicate either a programming error a malicious request. In either of these cases it makes sense to throw an exception instead of adding errors to the model.
- CComponent
- CValidator
- X2Validator
Direct known subclasses
ArrayValidator, ModuleModelNameValidator, RequiredIfNotSetValidator, X2ModelForeignKeyValidator, X2ModelUniqueIndexValidator
abstract protected
|
#
validateValue( CModel $object, mixed $value, mixed $attribute )
A nicer-to-use version of CValidator's validateAttribute () |
protected
|
#
validateAttribute( CModel $object, string $attribute )
Allows use of validateValue in place of CValidator validateAttribute. Also sets $object and $attribute instance properties. |
protected
|
addError(),
applyTo(),
clientValidateAttribute(),
createValidator(),
isEmpty(),
validate()
|
__call(),
__get(),
__isset(),
__set(),
__unset(),
asa(),
attachBehavior(),
attachBehaviors(),
attachEventHandler(),
canGetProperty(),
canSetProperty(),
detachBehavior(),
detachBehaviors(),
detachEventHandler(),
disableBehavior(),
disableBehaviors(),
enableBehavior(),
enableBehaviors(),
evaluateExpression(),
getEventHandlers(),
hasEvent(),
hasEventHandler(),
hasProperty(),
raiseEvent()
|
public
boolean
|
$throwExceptions | false |
#
if true, instead of adding error messages to the model, exceptions will be
thrown |
public
CException
|
$exceptionClass | 'CHttpException' |
#
type of exception that will get thrown if $throwExceptions is true |
public
boolean
|
$allowEmpty | false |
#
if true attribute will validate if it's empty |
protected
mixed
|
$object |
|
|
protected
mixed
|
$attribute |
|
$attributes,
$builtInValidators,
$enableClientValidation,
$except,
$message,
$on,
$safe,
$skipOnError
|