Documentation

Bic extends Constraint
in package

Contains the properties of a constraint definition.

Tags
Annotation
Target

({"PROPERTY", "METHOD", "ANNOTATION"})

author

Michael Hirschler michael.vhirsch@gmail.com

Table of Contents

Constants

CLASS_CONSTRAINT  = 'class'
Marks a constraint that can be put onto classes.
DEFAULT_GROUP  = 'Default'
The name of the group given to all constraints with no explicit group.
INVALID_BANK_CODE_ERROR  = '00559357-6170-4f29-aebd-d19330aa19cf'
INVALID_CASE_ERROR  = '11884038-3312-4ae5-9d04-699f782130c7'
INVALID_CHARACTERS_ERROR  = 'f424c529-7add-4417-8f2d-4b656e4833e2'
INVALID_COUNTRY_CODE_ERROR  = '1ce76f8d-3c1f-451c-9e62-fe9c3ed486ae'
INVALID_IBAN_COUNTRY_CODE_ERROR  = '29a2c3bb-587b-4996-b6f5-53081364cea5'
INVALID_LENGTH_ERROR  = '66dad313-af0b-4214-8566-6c799be9789c'
PROPERTY_CONSTRAINT  = 'property'
Marks a constraint that can be put onto properties.

Properties

$groups  : array<string|int, string>
The groups that the constraint belongs to.
$iban  : mixed
$ibanMessage  : mixed
$ibanPropertyPath  : mixed
$message  : mixed
$payload  : mixed
Domain-specific data attached to a constraint.
$errorNames  : mixed
Maps error codes to the names of their constants.

Methods

__construct()  : mixed
Initializes the constraint with options.
__get()  : mixed
Returns the value of a lazily initialized option.
__isset()  : bool
__set()  : mixed
Sets the value of a lazily initialized option.
addImplicitGroupName()  : mixed
Adds the given group if this constraint is in the Default group.
getDefaultOption()  : string|null
Returns the name of the default option.
getErrorName()  : string
Returns the name of the given error code.
getRequiredOptions()  : array<string|int, string>
Returns the name of the required options.
getTargets()  : string|array<string|int, string>
Returns whether the constraint can be put onto classes, properties or both.
validatedBy()  : string
Returns the name of the class that validates this constraint.
normalizeOptions()  : array<string|int, mixed>

Constants

CLASS_CONSTRAINT

Marks a constraint that can be put onto classes.

public mixed CLASS_CONSTRAINT = 'class'

DEFAULT_GROUP

The name of the group given to all constraints with no explicit group.

public mixed DEFAULT_GROUP = 'Default'

INVALID_BANK_CODE_ERROR

public mixed INVALID_BANK_CODE_ERROR = '00559357-6170-4f29-aebd-d19330aa19cf'

INVALID_CASE_ERROR

public mixed INVALID_CASE_ERROR = '11884038-3312-4ae5-9d04-699f782130c7'

INVALID_CHARACTERS_ERROR

public mixed INVALID_CHARACTERS_ERROR = 'f424c529-7add-4417-8f2d-4b656e4833e2'

INVALID_COUNTRY_CODE_ERROR

public mixed INVALID_COUNTRY_CODE_ERROR = '1ce76f8d-3c1f-451c-9e62-fe9c3ed486ae'

INVALID_IBAN_COUNTRY_CODE_ERROR

public mixed INVALID_IBAN_COUNTRY_CODE_ERROR = '29a2c3bb-587b-4996-b6f5-53081364cea5'

INVALID_LENGTH_ERROR

public mixed INVALID_LENGTH_ERROR = '66dad313-af0b-4214-8566-6c799be9789c'

PROPERTY_CONSTRAINT

Marks a constraint that can be put onto properties.

public mixed PROPERTY_CONSTRAINT = 'property'

Properties

$groups

The groups that the constraint belongs to.

public array<string|int, string> $groups

$iban

public mixed $iban

$ibanMessage

public mixed $ibanMessage = 'This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.'

$ibanPropertyPath

public mixed $ibanPropertyPath

$message

public mixed $message = 'This is not a valid Business Identifier Code (BIC).'

$payload

Domain-specific data attached to a constraint.

public mixed $payload

$errorNames

Maps error codes to the names of their constants.

protected static mixed $errorNames = [self::INVALID_LENGTH_ERROR => 'INVALID_LENGTH_ERROR', self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', self::INVALID_BANK_CODE_ERROR => 'INVALID_BANK_CODE_ERROR', self::INVALID_COUNTRY_CODE_ERROR => 'INVALID_COUNTRY_CODE_ERROR', self::INVALID_CASE_ERROR => 'INVALID_CASE_ERROR']

Methods

__construct()

Initializes the constraint with options.

public __construct([array<string|int, mixed> $options = null ][, string $message = null ][, string $iban = null ][, string $ibanPropertyPath = null ][, string $ibanMessage = null ][, array<string|int, mixed> $groups = null ][, mixed $payload = null ]) : mixed
Parameters
$options : array<string|int, mixed> = null

The options (as associative array) or the value for the default option (any other type)

$message : string = null
$iban : string = null
$ibanPropertyPath : string = null
$ibanMessage : string = null
$groups : array<string|int, mixed> = null

An array of validation groups

$payload : mixed = null

Domain-specific data attached to a constraint

__get()

Returns the value of a lazily initialized option.

public __get(string $option) : mixed

Corresponding properties are added to the object on first access. Hence this method will be called at most once per constraint instance and option name.

Parameters
$option : string
Tags
throws
InvalidOptionsException

If an invalid option name is given

__isset()

public __isset(string $option) : bool
Parameters
$option : string
Return values
bool

__set()

Sets the value of a lazily initialized option.

public __set(string $option, mixed $value) : mixed

Corresponding properties are added to the object on first access. Hence this method will be called at most once per constraint instance and option name.

Parameters
$option : string
$value : mixed
Tags
throws
InvalidOptionsException

If an invalid option name is given

addImplicitGroupName()

Adds the given group if this constraint is in the Default group.

public addImplicitGroupName(string $group) : mixed
Parameters
$group : string

getDefaultOption()

Returns the name of the default option.

public getDefaultOption() : string|null

Override this method to define a default option.

Tags
see
__construct()
Return values
string|null

getErrorName()

Returns the name of the given error code.

public static getErrorName(string $errorCode) : string
Parameters
$errorCode : string
Tags
throws
InvalidArgumentException

If the error code does not exist

Return values
string

getRequiredOptions()

Returns the name of the required options.

public getRequiredOptions() : array<string|int, string>

Override this method if you want to define required options.

Tags
see
__construct()
Return values
array<string|int, string>

getTargets()

Returns whether the constraint can be put onto classes, properties or both.

public getTargets() : string|array<string|int, string>

This method should return one or more of the constants Constraint::CLASS_CONSTRAINT and Constraint::PROPERTY_CONSTRAINT.

Return values
string|array<string|int, string>

One or more constant values

validatedBy()

Returns the name of the class that validates this constraint.

public validatedBy() : string

By default, this is the fully qualified name of the constraint class suffixed with "Validator". You can override this method to change that behavior.

Return values
string

normalizeOptions()

protected normalizeOptions(mixed $options) : array<string|int, mixed>
Parameters
$options : mixed
Return values
array<string|int, mixed>

        
On this page

Search results