You are currently viewing the 1.1 version of the API documentation. Switch to 1.0 or 1.2.

Doctrine Validator

This class is responsible for performing all validations on record properties

Method Summary

Returns Name Description Code
integer getStringLength Get length of passed string. Will use multibyte character functions if they exist L118
Doctrine_Validator_Interface getValidator Get a validator instance for the passed $name L47
boolean hasErrors Whether or not errors exist on this validator L134
boolean isValidType Validate the type of the passed variable L146
boolean validateLength Validates the length of a field. L90
validateRecord Validates a given record and saves possible errors in Doctrine_Validator::$stack L69

Method Details

  • (integer) getStringLength($string)

    Get length of passed string. Will use multibyte character functions if they exist


  • $name Name of the validator or the validator class name

    (Doctrine_Validator_Interface) getValidator($name)

    Get a validator instance for the passed $name


  • (boolean) hasErrors()

    Whether or not errors exist on this validator

    returns True/false for whether or not this validate instance has error


  • $var Variable to validate
    $type Type of the variable expected

    (boolean) isValidType($var, $type)

    Validate the type of the passed variable


  • $value Value to validate
    $type Type of field being validated
    $maximumLength Maximum length allowed for the column

    (boolean) validateLength($value, $type, $maximumLength)

    Validates the length of a field.

    returns True/false for whether the value passed validation


  • validateRecord($record)

    Validates a given record and saves possible errors in Doctrine_Validator::$stack