PHP 클래스 CommerceGuys\Addressing\Validator\Constraints\AddressFormatConstraintValidator

상속: extends Symfony\Component\Validator\ConstraintValidator
파일 보기 프로젝트 열기: commerceguys/addressing

보호된 프로퍼티들

프로퍼티 타입 설명
$addressFormatRepository CommerceGuys\Addressing\AddressFormat\AddressFormatRepositoryInterface The address format repository.
$subdivisionRepository CommerceGuys\Addressing\Subdivision\SubdivisionRepositoryInterface The subdivision repository.

공개 메소드들

메소드 설명
__construct ( CommerceGuys\Addressing\AddressFormat\AddressFormatRepositoryInterface $addressFormatRepository = null, CommerceGuys\Addressing\Subdivision\SubdivisionRepositoryInterface $subdivisionRepository = null ) Creates an AddressFormatValidator instance.
validate ( $value, Constraint $constraint )

보호된 메소드들

메소드 설명
addViolation ( string $field, string $message, mixed $invalidValue, AddressFormat $addressFormat ) Adds a violation.
extractAddressValues ( CommerceGuys\Addressing\AddressInterface $address ) : array Extracts the address values.
validateFields ( array $values, AddressFormat $addressFormat, Constraint $constraint ) Validates the provided field values.
validatePostalCode ( string $postalCode, array $subdivisions, AddressFormat $addressFormat, Constraint $constraint ) Validates the provided postal code.
validateSubdivisions ( array $values, AddressFormat $addressFormat, Constraint $constraint ) : array Validates the provided subdivision values.

메소드 상세

__construct() 공개 메소드

Creates an AddressFormatValidator instance.
public __construct ( CommerceGuys\Addressing\AddressFormat\AddressFormatRepositoryInterface $addressFormatRepository = null, CommerceGuys\Addressing\Subdivision\SubdivisionRepositoryInterface $subdivisionRepository = null )
$addressFormatRepository CommerceGuys\Addressing\AddressFormat\AddressFormatRepositoryInterface
$subdivisionRepository CommerceGuys\Addressing\Subdivision\SubdivisionRepositoryInterface

addViolation() 보호된 메소드

Accounts for differences between Symfony versions.
protected addViolation ( string $field, string $message, mixed $invalidValue, AddressFormat $addressFormat )
$field string The field.
$message string The error message.
$invalidValue mixed The invalid, validated value.
$addressFormat CommerceGuys\Addressing\AddressFormat\AddressFormat The address format.

extractAddressValues() 보호된 메소드

Extracts the address values.
protected extractAddressValues ( CommerceGuys\Addressing\AddressInterface $address ) : array
$address CommerceGuys\Addressing\AddressInterface The address.
리턴 array An array of values keyed by field constants.

validate() 공개 메소드

public validate ( $value, Constraint $constraint )
$constraint Symfony\Component\Validator\Constraint

validateFields() 보호된 메소드

Validates the provided field values.
protected validateFields ( array $values, AddressFormat $addressFormat, Constraint $constraint )
$values array The field values, keyed by field constants.
$addressFormat CommerceGuys\Addressing\AddressFormat\AddressFormat The address format.
$constraint Symfony\Component\Validator\Constraint The constraint.

validatePostalCode() 보호된 메소드

Validates the provided postal code.
protected validatePostalCode ( string $postalCode, array $subdivisions, AddressFormat $addressFormat, Constraint $constraint )
$postalCode string The postal code.
$subdivisions array An array of found valid subdivisions.
$addressFormat CommerceGuys\Addressing\AddressFormat\AddressFormat The address format.
$constraint Symfony\Component\Validator\Constraint The constraint.

validateSubdivisions() 보호된 메소드

Validates the provided subdivision values.
protected validateSubdivisions ( array $values, AddressFormat $addressFormat, Constraint $constraint ) : array
$values array The field values, keyed by field constants.
$addressFormat CommerceGuys\Addressing\AddressFormat\AddressFormat The address format.
$constraint Symfony\Component\Validator\Constraint The constraint.
리턴 array An array of found valid subdivisions.

프로퍼티 상세

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

The address format repository.
protected AddressFormatRepositoryInterface,CommerceGuys\Addressing\AddressFormat $addressFormatRepository
리턴 CommerceGuys\Addressing\AddressFormat\AddressFormatRepositoryInterface

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

The subdivision repository.
protected SubdivisionRepositoryInterface,CommerceGuys\Addressing\Subdivision $subdivisionRepository
리턴 CommerceGuys\Addressing\Subdivision\SubdivisionRepositoryInterface