PHP 클래스 Symfony\Component\Validator\Constraints\GroupSequence

When validating a group sequence, each group will only be validated if all of the previous groups in the sequence succeeded. For example: $validator->validate($address, null, new GroupSequence(array('Basic', 'Strict'))); In the first step, all constraints that belong to the group "Basic" will be validated. If none of the constraints fail, the validator will then validate the constraints in group "Strict". This is useful, for example, if "Strict" contains expensive checks that require a lot of CPU or slow, external services. You usually don't want to run expensive checks if any of the cheap checks fail. When adding metadata to a class, you can override the "Default" group of that class with a group sequence: ** * @GroupSequence({"Address", "Strict"}) *\/ class Address { ... } Whenever you validate that object in the "Default" group, the group sequence will be validated: $validator->validate($address); If you want to execute the constraints of the "Default" group for a class with an overridden default group, pass the class name as group name instead: $validator->validate($address, null, "Address")
저자: Bernhard Schussek ([email protected])
파일 보기 프로젝트 열기: pmjones/php-framework-benchmarks

공개 프로퍼티들

프로퍼티 타입 설명
$groups array The members of the sequence

공개 메소드들

메소드 설명
__construct ( array $groups )

메소드 상세

__construct() 공개 메소드

public __construct ( array $groups )
$groups array

프로퍼티 상세

$groups 공개적으로 프로퍼티

The members of the sequence
public array $groups
리턴 array