PHP 클래스 Symfony\Component\Validator\ConstraintValidator

저자: Bernhard Schussek ([email protected])
상속: implements Symfony\Component\Validator\ConstraintValidatorInterface
파일 보기 프로젝트 열기: symfony/validator 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$context ExecutionContextInterface2Dot5

공개 메소드들

메소드 설명
initialize ( Symfony\Component\Validator\Context\ExecutionContextInterface $context )

보호된 메소드들

메소드 설명
formatTypeOf ( mixed $value ) : string Returns a string representation of the type of the value.
formatValue ( mixed $value, integer $format ) : string Returns a string representation of the value.
formatValues ( array $values, integer $format ) : string Returns a string representation of a list of values.

메소드 상세

formatTypeOf() 보호된 메소드

This method should be used if you pass the type of a value as message parameter to a constraint violation. Note that such parameters should usually not be included in messages aimed at non-technical people.
protected formatTypeOf ( mixed $value ) : string
$value mixed The value to return the type of
리턴 string The type of the value

formatValue() 보호된 메소드

This method returns the equivalent PHP tokens for most scalar types (i.e. "false" for false, "1" for 1 etc.). Strings are always wrapped in double quotes ("). Objects, arrays and resources are formatted as "object", "array" and "resource". If the $format bitmask contains the PRETTY_DATE bit, then {@link \DateTime} objects will be formatted as RFC-3339 dates ("Y-m-d H:i:s"). Be careful when passing message parameters to a constraint violation that (may) contain objects, arrays or resources. These parameters should only be displayed for technical users. Non-technical users won't know what an "object", "array" or "resource" is and will be confused by the violation message.
protected formatValue ( mixed $value, integer $format ) : string
$value mixed The value to format as string
$format integer A bitwise combination of the format constants in this class
리턴 string The string representation of the passed value

formatValues() 보호된 메소드

Each of the values is converted to a string using {@link formatValue()}. The values are then concatenated with commas.
또한 보기: formatValue()
protected formatValues ( array $values, integer $format ) : string
$values array A list of values
$format integer A bitwise combination of the format constants in this class
리턴 string The string representation of the value list

initialize() 공개 메소드

public initialize ( Symfony\Component\Validator\Context\ExecutionContextInterface $context )
$context Symfony\Component\Validator\Context\ExecutionContextInterface

프로퍼티 상세

$context 보호되어 있는 프로퍼티

protected ExecutionContextInterface2Dot5 $context
리턴 ExecutionContextInterface2Dot5