Class Validator
public
|
#
__construct( mixed $attributes, array $rules, array $messages = array() )
Create a new validator instance. |
public static
|
|
public static
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
protected
|
|
protected
boolean
|
#
validatable( string $rule, string $attribute, mixed $value )
Determine if an attribute is validatable. |
protected
boolean
|
|
protected
|
|
protected
boolean
|
#
validate_required( string $attribute, mixed $value )
Validate that a required attribute exists in the attributes array. |
protected
boolean
|
#
validate_required_with( string $attribute, mixed $value, array $parameters )
Validate that an attribute exists in the attributes array, if another attribute exists in the attributes array. |
protected
boolean
|
#
validate_confirmed( string $attribute, mixed $value )
Validate that an attribute has a matching confirmation attribute. |
protected
boolean
|
|
protected
boolean
|
#
validate_same( string $attribute, mixed $value, array $parameters )
Validate that an attribute is the same as another attribute. |
protected
boolean
|
#
validate_different( string $attribute, mixed $value, array $parameters )
Validate that an attribute is different from another attribute. |
protected
boolean
|
|
protected
boolean
|
|
protected
boolean
|
#
validate_size( string $attribute, mixed $value, array $parameters )
Validate the size of an attribute. |
protected
boolean
|
#
validate_between( string $attribute, mixed $value, array $parameters )
Validate the size of an attribute is between a set of values. |
protected
boolean
|
#
validate_min( string $attribute, mixed $value, array $parameters )
Validate the size of an attribute is greater than a minimum value. |
protected
boolean
|
#
validate_max( string $attribute, mixed $value, array $parameters )
Validate the size of an attribute is less than a maximum value. |
protected
mixed
|
|
protected
boolean
|
#
validate_in( string $attribute, mixed $value, array $parameters )
Validate an attribute is contained within a list of values. |
protected
boolean
|
#
validate_not_in( string $attribute, mixed $value, array $parameters )
Validate an attribute is not contained within a list of values. |
protected
boolean
|
#
validate_unique( string $attribute, mixed $value, array $parameters )
Validate the uniqueness of an attribute value on a given database table. |
protected
boolean
|
#
validate_exists( string $attribute, mixed $value, array $parameters )
Validate the existence of an attribute value in a database table. |
protected
boolean
|
|
protected
boolean
|
#
validate_email( string $attribute, mixed $value )
Validate that an attribute is a valid e-mail address. |
protected
boolean
|
|
protected
boolean
|
#
validate_active_url( string $attribute, mixed $value )
Validate that an attribute is an active URL. |
protected
boolean
|
#
validate_image( string $attribute, mixed $value )
Validate the MIME type of a file is an image MIME type. |
protected
boolean
|
#
validate_alpha( string $attribute, mixed $value )
Validate that an attribute contains only alphabetic characters. |
protected
boolean
|
#
validate_alpha_num( string $attribute, mixed $value )
Validate that an attribute contains only alpha-numeric characters. |
protected
boolean
|
#
validate_alpha_dash( string $attribute, mixed $value )
Validate that an attribute contains only alpha-numeric characters, dashes, and underscores. |
protected
boolean
|
#
validate_match( string $attribute, mixed $value, array $parameters )
Validate that an attribute passes a regular expression check. |
protected
boolean
|
#
validate_mimes( string $attribute, array $value, array $parameters )
Validate the MIME type of a file upload attribute is in a set of MIME types. |
protected
boolean
|
|
protected
boolean
|
#
validate_count( string $attribute, mixed $value, array $parameters )
Validate that an attribute of type array has a specific count |
protected
boolean
|
#
validate_countmin( string $attribute, mixed $value, array $parameters )
Validate that an attribute of type array has a minimum of elements. |
protected
boolean
|
#
validate_countmax( string $attribute, mixed $value, array $parameters )
Validate that an attribute of type array has a maximum of elements. |
protected
boolean
|
#
validate_countbetween( string $attribute, mixed $value, array $parameters )
Validate that an attribute of type array has elements between max and min. |
protected
boolean
|
#
validate_before( string $attribute, mixed $value, array $parameters )
Validate the date is before a given date. |
protected
boolean
|
#
validate_after( string $attribute, mixed $value, array $parameters )
Validate the date is after a given date. |
protected
boolean
|
#
validate_date_format( string $attribute, mixed $value, array $parameters )
Validate the date conforms to a given format. |
protected
string
|
|
protected
string
|
#
size_message( string $bundle, string $attribute, string $rule )
Get the proper error message for an attribute and size rule. |
protected
string
|
|
protected
string
|
#
replace_required_with( string $message, string $attribute, string $rule, array $parameters )
Replace all place-holders for the required_with rule. |
protected
string
|
#
replace_between( string $message, string $attribute, string $rule, array $parameters )
Replace all place-holders for the between rule. |
protected
string
|
#
replace_size( string $message, string $attribute, string $rule, array $parameters )
Replace all place-holders for the size rule. |
protected
string
|
#
replace_min( string $message, string $attribute, string $rule, array $parameters )
Replace all place-holders for the min rule. |
protected
string
|
#
replace_max( string $message, string $attribute, string $rule, array $parameters )
Replace all place-holders for the max rule. |
protected
string
|
#
replace_in( string $message, string $attribute, string $rule, array $parameters )
Replace all place-holders for the in rule. |
protected
string
|
#
replace_not_in( string $message, string $attribute, string $rule, array $parameters )
Replace all place-holders for the not_in rule. |
protected
string
|
#
replace_mimes( string $message, string $attribute, string $rule, array $parameters )
Replace all place-holders for the mimes rule. |
protected
string
|
#
replace_same( string $message, string $attribute, string $rule, array $parameters )
Replace all place-holders for the same rule. |
protected
string
|
#
replace_different( string $message, string $attribute, string $rule, array $parameters )
Replace all place-holders for the different rule. |
protected
string
|
#
replace_before( string $message, string $attribute, string $rule, array $parameters )
Replace all place-holders for the before rule. |
protected
string
|
#
replace_after( string $message, string $attribute, string $rule, array $parameters )
Replace all place-holders for the after rule. |
protected
string
|
#
replace_count( string $message, string $attribute, string $rule, array $parameters )
Replace all place-holders for the count rule. |
protected
string
|
#
replace_countmin( string $message, string $attribute, string $rule, array $parameters )
Replace all place-holders for the countmin rule. |
protected
string
|
#
replace_countmax( string $message, string $attribute, string $rule, array $parameters )
Replace all place-holders for the countmax rule. |
protected
string
|
#
replace_countbetween( string $message, string $attribute, string $rule, array $parameters )
Replace all place-holders for the between rule. |
protected
string
|
|
protected
boolean
|
|
protected
array
|
|
public
|
|
public
|
|
public
|
#
connection(
Set the database connection that should be used by the validator. |
protected
|
|
public
|
public
array
|
$attributes |
|
#
The array being validated. |
public
|
$errors |
|
#
The post-validation error messages. |
protected
array
|
$rules | array() |
#
The validation rules. |
protected
array
|
$messages | array() |
#
The validation messages. |
protected
|
$db |
|
#
The database connection that should be used by the validator. |
protected
string
|
$bundle | DEFAULT_BUNDLE |
#
The bundle for which the validation is being run. |
protected
string
|
$language |
|
#
The language that should be used when retrieving error messages. |
protected
array
|
$size_rules | array('size', 'between', 'min', 'max') |
#
The size related validation rules. |
protected
array
|
$numeric_rules | array('numeric', 'integer') |
#
The numeric related validation rules. |
protected static
array
|
$validators | array() |
#
The registered custom validators. |