Class CompanyIdEu
Responsibility: Validate company ID for EU states by regular expression(s) or by closure function(s). - DO NOT USE ANY ADVANCED CONSTRUCTIONS for validations, because there are lot of checking exceptions! - Return from Validate()
function safe submitted value or NULL
if there is not possible to return safe value.
- MvcCore\Ext\Forms\Validator implements MvcCore\Ext\Forms\IValidator
-
MvcCore\Ext\Forms\Validators\CompanyIdEu
See: https://en.wikipedia.org/wiki/VAT_identification_number
See: http://studylib.net/doc/7254793/vat-number-construction-rules
See: http://85.81.229.78/systems/DKVIES/-%20Arkiv/Algoritme%E6ndringer/VIES-VAT%20Validation%20Routines-v15.0.doc
Located at ext-form-validator-special/src/MvcCore/Ext/Forms/Validators/CompanyIdEu.php
public static
string|callable
|
#
SetValidator( string $localeCode, string|callable $regExpMatchOrCallable )
Set specific locale validator for company ID.
It could be regular expression match pattern string without border characters ( |
public static
array
&
|
#
GetValidators( )
Get all preconfigured validators as key/value array.
Keys are locale codes and values are regular expression match
pattern strings or array with regular expression match
pattern strings or |
public
string|array|null
|
#
Validate( string|array $rawSubmittedValue )
Validate company ID for EU states by regular expression(s) or by closure function.
Do not use any advanced constructions for validations, because there are lot of checking exceptions.
Return safe submitted value as result or |
protected
array
|
#
validateCompanyIdByRegExp( string $submittedValue, string $regExpMatch, string $localeCode )
Validate company ID by regular expression match pattern. Return if matches and safe company id value. |
CreateInstance(),
GetErrorMessage(),
SetField(),
SetForm(),
__construct(),
setUpFieldProps(),
throwNewInvalidArgumentException()
|
integer |
ERROR_SUBJECT_ID
Error message index(es). |
#
0
|
integer |
ERROR_COMPANY_ID
|
#
1
|
protected static
array
|
$errorMessages
Validation failure message template definitions. |
#
[
self::ERROR_SUBJECT_ID => "Field '{0}' requires a valid subject ID.",
self::ERROR_COMPANY_ID => "Field '{0}' requires a valid company ID.",
]
|
protected static
array
|
$validators
EU company IDs validators.
Array of regular expression match patterns to check company ID.
Keys are locale code strings and values are regular expression |
#
[]
|
$field,
$fieldSpecificProperties,
$form,
$toolClass
|