PHP 클래스 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.
저자: Bernhard Schussek ([email protected])
파일 보기 프로젝트 열기: pmjones/php-framework-benchmarks 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$groups array

공개 메소드들

메소드 설명
__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

메소드 상세

__construct() 공개 메소드

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() 공개 메소드

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

addImplicitGroupName() 공개 메소드

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

getDefaultOption() 공개 메소드

Override this method to define a default option.
또한 보기: __construct()
public getDefaultOption ( ) : string
리턴 string

getRequiredOptions() 공개 메소드

Override this method if you want to define required options.
또한 보기: __construct()
public getRequiredOptions ( ) : array
리턴 array

getTargets() 공개 메소드

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

validatedBy() 공개 메소드

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
리턴 string

프로퍼티 상세

$groups 공개적으로 프로퍼티

public array $groups
리턴 array