LocaleInfoLVA
extends LocaleInfoEurozone
in package
Locale info for Latvia; see {@see LocaleInfo}
Table of Contents
Properties
- $auto : mixed
- $currency_decimal : mixed
- $currency_iso : mixed
- $currency_name : mixed
- $currency_symbol : mixed
- $decimal_seperator : mixed
- $group_seperator : mixed
- $line1 : mixed
- $line2 : mixed
- $longdate : mixed
- $phone_code : mixed
- $postcode_name : mixed
- $shortdate : mixed
- $state_list : mixed
- $state_name : mixed
- $time : mixed
- $town_name : mixed
Methods
- auto() : LocaleInfo
- Automatically chooses a locale and returns it
- get() : LocaleInfo
- Returns the LocaleInfo class for the specified country code.
- getCurrencyISO() : string
- Return currency ISO code, eg 'AUD'
- getCurrencyName() : string
- The name of the currency, e.g. 'Dollar' for $
- getParameters() : mixed
- Return the raw parameters of this locale
- getPhoneCode() : string
- Return phone code, eg '213'
- getStateList() : array<string|int, mixed>
- Gets a list of states
- getStateName() : string
- Get the name of a given state by looking it up in the states list
- longdate() : string
- Formats dates in a long format
- moneyFormat() : string
- Formats currency values, similar to the interal {@see number_format} function
- nonNumericStates() : array<string|int, mixed>
- Organises the state list so that it doesn't have numeric keys.
- numberFormat() : string
- Formats numbers, like the interal {@see number_format} function
- outputAddressField() : string
- Generates a single address field for the current locale
- outputAddressFields() : string
- Generates the address fields for the current locale
- outputAddressText() : string
- Returns a string which is a formatted version of the address specified using the provided data.
- shortdate() : string
- Formats dates in a short format
- stateValues() : array<string|int, mixed>
- Extracts only the enterable values from the state list
- time() : string
- Formats times
- validateAddress() : void
- Validate address fields
Properties
$auto
public
static mixed
$auto
$currency_decimal
protected
mixed
$currency_decimal
= 2
$currency_iso
protected
mixed
$currency_iso
= 'EUR'
$currency_name
protected
mixed
$currency_name
= 'Euro'
$currency_symbol
protected
mixed
$currency_symbol
= '€'
$decimal_seperator
protected
mixed
$decimal_seperator
= ','
$group_seperator
protected
mixed
$group_seperator
= '.'
$line1
protected
mixed
$line1
= 'Line 1'
$line2
protected
mixed
$line2
= 'Line 2'
$longdate
protected
mixed
$longdate
= 'D jS M Y'
$phone_code
protected
mixed
$phone_code
= '371'
$postcode_name
protected
mixed
$postcode_name
= 'Postcode'
$shortdate
protected
mixed
$shortdate
= 'j/n/Y'
$state_list
protected
mixed
$state_list
= ['Aglonas novads', 'Aizkraukles novads', 'Aizputes novads', 'Aknīstes novads', 'Alojas novads', 'Alsungas novads', 'Alūksnes novads', 'Amatas novads', 'Apes novads', 'Auces novads', 'Ādažu novads', 'Babītes novads', 'Baldones novads', 'Baltinavas novads', 'Balvu novads', 'Bauskas novads', 'Beverīnas novads', 'Brocēnu novads', 'Burtnieku novads', 'Carnikavas novads', 'Cesvaines novads', 'Cēsu novads', 'Ciblas novads', 'Dagdas novads', 'Daugavpils novads', 'Dobeles novads', 'Dundagas novads', 'Durbes novads', 'Engures novads', 'Ērgļu novads', 'Garkalnes novads', 'Grobiņas novads', 'Gulbenes novads', 'Iecavas novads', 'Ikšķiles novads', 'Ilūkstes novads', 'Inčukalna novads', 'Jaunjelgavas novads', 'Jaunpiebalgas novads', 'Jaunpils novads', 'Jelgavas novads', 'Jēkabpils novads', 'Kandavas novads', 'Kārsavas novads', 'Kocēnu novads', 'Kokneses novads', 'Kraslavas novads', 'Krimuldas novads', 'Krustpils novads', 'Kuldīgas novads', 'Ķeguma novads', 'Ķekavas novads', 'Lielvārdes novads', 'Limbažu novads', 'Līgatnes novads', 'Līvānu novads', 'Lubanas novads', 'Ludzas novads', 'Madonas novads', 'Mazsalacas novads', 'Mālpils novads', 'Mārupes novads', 'Mērsraga novads', 'Naukšēnu novads', 'Neretas novads', 'Nīcas novads', 'Ogres novads', 'Olaines novads', 'Ozolnieku novads', 'Pārgaujas novads', 'Pāvilostas novads', 'Pļaviņu novads', 'Preilu novads', 'Priekules novads', 'Priekuļu novads', 'Raunas novads', 'Rēzeknes novads', 'Riebiņu novads', 'Rojas novads', 'Ropažu novads', 'Rucavas novads', 'Rugāju novads', 'Rundāles novads', 'Rūjienas novads', 'Salas novads', 'Salacgrīvas novads', 'Salaspils novads', 'Saldus novads', 'Saulkrastu novads', 'Sējas novads', 'Siguldas novads', 'Skrīveru novads', 'Skrundas novads', 'Smiltenes novads', 'Stopiņu novads', 'Strenču novads', 'Talsu novads', 'Tērvetes novads', 'Tukuma novads', 'Vaiņodes novads', 'Valkas novads', 'Varakļānu novads', 'Vārkavas novads', 'Vecpiebalgas novads', 'Vecumnieku novads', 'Ventspils novads', 'Viesītes novads', 'Viļakas novads', 'Viļānu novads', 'Zilupes novads', 'Daugavpils', 'Jelgava', 'Jēkabpils', 'Jūrmala', 'Liepāja', 'Rēzekne', 'Rīga', 'Ventspils', 'Valmiera']
$state_name
protected
mixed
$state_name
= 'State/Province'
$time
protected
mixed
$time
= 'g:ia'
$town_name
protected
mixed
$town_name
= 'Suburb/Town'
Methods
auto()
Automatically chooses a locale and returns it
public
static auto() : LocaleInfo
Return values
LocaleInfoget()
Returns the LocaleInfo class for the specified country code.
public
static get([string $code = null ]) : LocaleInfo
If no LocaleInfo can be found, a generic version is used.
Parameters
- $code : string = null
-
3-letter country code (ISO 3166-1 alpha-3)
Return values
LocaleInfogetCurrencyISO()
Return currency ISO code, eg 'AUD'
public
getCurrencyISO() : string
Return values
string —eg 'AUD'
getCurrencyName()
The name of the currency, e.g. 'Dollar' for $
public
getCurrencyName() : string
Return values
stringgetParameters()
Return the raw parameters of this locale
public
getParameters() : mixed
getPhoneCode()
Return phone code, eg '213'
public
getPhoneCode() : string
Return values
string —eg '213'
getStateList()
Gets a list of states
public
getStateList() : array<string|int, mixed>
Return values
array<string|int, mixed> —For use with Fb::dropdown
getStateName()
Get the name of a given state by looking it up in the states list
public
getStateName(string $val) : string
Parameters
- $val : string
-
Values stored by the LocaleInfo::outputAddressFields dropdown field
Return values
string —Full name of state, e.g. 'South Australia'
longdate()
Formats dates in a long format
public
longdate(int $timestamp) : string
Parameters
- $timestamp : int
-
Unix timestamp
Return values
stringmoneyFormat()
Formats currency values, similar to the interal {@see number_format} function
public
moneyFormat(int|float $number[, int $precision = null ]) : string
Parameters
- $number : int|float
-
The number to format
- $precision : int = null
-
The number of decimal places to render; if NULL then it's locale-dependent
Return values
stringnonNumericStates()
Organises the state list so that it doesn't have numeric keys.
public
nonNumericStates() : array<string|int, mixed>
The state names become the form field values if state list is a numeric array. This makes it easy to configure a new locate with states/provinces/etc which don't have standard abbreviations.
E.g. ['State 1', 'State 2'] would become: ['State 1' => 'State 1', 'State 2' => 'State 2']
Return values
array<string|int, mixed>numberFormat()
Formats numbers, like the interal {@see number_format} function
public
numberFormat(int|float $number[, int $precision = 0 ]) : string
Parameters
- $number : int|float
-
The number to format
- $precision : int = 0
-
The number of decimal places to render
Return values
stringoutputAddressField()
Generates a single address field for the current locale
public
outputAddressField(string $field[, string $prefix = '' ][, bool $required = false ]) : string
Parameters
- $field : string
-
'street', 'street2', 'town', 'state', or 'postcode'
- $prefix : string = ''
-
Optional prefix, e.g. 'postal_'
- $required : bool = false
-
True if the address as a whole is required, irrespective of the individual field
Return values
stringoutputAddressFields()
Generates the address fields for the current locale
public
outputAddressFields([string $prefix = '' ][, bool $required = false ]) : string
Parameters
- $prefix : string = ''
-
Optional prefix, e.g. 'postal_'
- $required : bool = false
-
True if the address as a whole is required, irrespective of individual fields
Return values
stringoutputAddressText()
Returns a string which is a formatted version of the address specified using the provided data.
public
outputAddressText(array<string|int, mixed>|object $data) : string
The string contains newlines which will need converting to BRs for HTML output
Parameters
- $data : array<string|int, mixed>|object
-
A record from the database required columns: street, town, state, postcode, country
Return values
string —Plaintext
shortdate()
Formats dates in a short format
public
shortdate(int $timestamp) : string
Parameters
- $timestamp : int
-
Unix timestamp
Return values
stringstateValues()
Extracts only the enterable values from the state list
public
stateValues() : array<string|int, mixed>
This should be used for validation.
Return values
array<string|int, mixed>time()
Formats times
public
time(int $timestamp) : string
Parameters
- $timestamp : int
-
Unix timestamp
Return values
stringvalidateAddress()
Validate address fields
public
validateAddress(Validator $valid[, bool $required = false ]) : void
Parameters
- $valid : Validator
-
Validator for the form being processed
- $required : bool = false
-
Are the address fields required?