PHP Класс CommerceGuys\Addressing\Validator\Constraints\AddressFormatConstraintValidator

Наследование: extends Symfony\Component\Validator\ConstraintValidator
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$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