PHP Class Symfony\Component\Validator\Constraint

A constraint can be defined on a class, an option or a getter method. The Constraint class encapsulates all the configuration required for validating this class, option or getter result successfully. Constraint instances are immutable and serializable.
Author: Bernhard Schussek ([email protected])
Afficher le fichier Open project: pmjones/php-framework-benchmarks Class Usage Examples

Méthodes publiques

Свойство Type Description
$groups array

Méthodes publiques

Méthode Description
__construct ( mixed $options = null ) Initializes the constraint with options.
__set ( $option, $value ) Unsupported operation.
addImplicitGroupName ( string $group ) Adds the given group if this constraint is in the Default group
getDefaultOption ( ) : string Returns the name of the default option
getRequiredOptions ( ) : array Returns the name of the required options
getTargets ( ) : string | array Returns whether the constraint can be put onto classes, properties or both
validatedBy ( ) : string Returns the name of the class that validates this constraint

Method Details

__construct() public méthode

You should pass an associative array. The keys should be the names of existing properties in this class. The values should be the value for these properties. Alternatively you can override the method getDefaultOption() to return the name of an existing property. If no associative array is passed, this property is set instead. You can force that certain options are set by overriding getRequiredOptions() to return the names of these options. If any option is not set here, an exception is thrown.
public __construct ( mixed $options = null )
$options mixed The options (as associative array) or the value for the default option (any other type)

__set() public méthode

Unsupported operation.
public __set ( $option, $value )

addImplicitGroupName() public méthode

Adds the given group if this constraint is in the Default group
public addImplicitGroupName ( string $group )
$group string

getDefaultOption() public méthode

Override this method to define a default option.
See also: __construct()
public getDefaultOption ( ) : string
Résultat string

getRequiredOptions() public méthode

Override this method if you want to define required options.
See also: __construct()
public getRequiredOptions ( ) : array
Résultat array

getTargets() public méthode

This method should return one or more of the constants Constraint::CLASS_CONSTRAINT and Constraint::PROPERTY_CONSTRAINT.
public getTargets ( ) : string | array
Résultat string | array One or more constant values

validatedBy() public méthode

By default, this is the fully qualified name of the constraint class suffixed with "Validator". You can override this method to change that behaviour.
public validatedBy ( ) : string
Résultat string

Property Details

$groups public_oe property

public array $groups
Résultat array