ValidationContext
in package
Read onlyYes
FinalYes
Information available to rules while validating an invoice.
Table of Contents
Properties
- $countryPacks : array<string|int, mixed>
- $locale : string
- $messageLocale : string|null
- $options : array<string|int, mixed>
- $profile : Profile
- $translator : Translator|null
Methods
- __construct() : mixed
- hasCountry() : bool
- intOption() : int
- leadingCountry() : string|null
- messageLocale() : string
- Language of the messages: the configured one (validation.locale), otherwise the language of the run. Rules that check texts of the invoice use $locale instead.
- option() : mixed
- profileIs() : bool
- translator() : Translator
Properties
$countryPacks
public
array<string|int, mixed>
$countryPacks
= []
$locale
public
string
$locale
= 'en'
$messageLocale
public
string|null
$messageLocale
= null
$options
public
array<string|int, mixed>
$options
= []
$profile
public
Profile
$profile
$translator
public
Translator|null
$translator
= null
Methods
__construct()
public
__construct(Profile $profile[, array<int, CountryPack> $countryPacks = [] ][, string $locale = 'en' ][, Translator|null $translator = null ][, array<string, mixed> $options = [] ][, string|null $messageLocale = null ]) : mixed
Parameters
- $profile : Profile
- $countryPacks : array<int, CountryPack> = []
-
leading pack first
- $locale : string = 'en'
- $translator : Translator|null = null
- $options : array<string, mixed> = []
-
e.g. attachment_max_bytes, attachments_max_total_bytes
- $messageLocale : string|null = null
hasCountry()
public
hasCountry(string $code) : bool
Parameters
- $code : string
Return values
boolintOption()
public
intOption(string $key, int $default) : int
Parameters
- $key : string
- $default : int
Return values
intleadingCountry()
public
leadingCountry() : string|null
Return values
string|nullmessageLocale()
Language of the messages: the configured one (validation.locale), otherwise the language of the run. Rules that check texts of the invoice use $locale instead.
public
messageLocale() : string
Return values
stringoption()
public
option(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
- $default : mixed = null
profileIs()
public
profileIs(string ...$keys) : bool
Parameters
- $keys : string
Return values
booltranslator()
public
translator() : Translator