API reference / Quittio \ Core \ Enums
UnitCode
string-backed enum in quittio/core · uses HasLabel
Quittio\Core\Enums\UnitCode · Source
Unit of measure (BT-130, BT-150), UN/ECE Recommendation 20 and 21. Further codes can be used as RawCode.
Cases#
| Case | Value | Description |
|---|---|---|
Unit | 'C62' | |
Piece | 'H87' | |
Set | 'SET' | |
Pair | 'PR' | |
Dozen | 'DZN' | |
LumpSum | 'LS' | |
Second | 'SEC' | |
Minute | 'MIN' | |
Hour | 'HUR' | |
Day | 'DAY' | |
Week | 'WEE' | |
Month | 'MON' | |
Quarter | 'QAN' | |
Year | 'ANN' | |
Gram | 'GRM' | |
Kilogram | 'KGM' | |
Tonne | 'TNE' | |
Millimetre | 'MMT' | |
Centimetre | 'CMT' | |
Metre | 'MTR' | |
Kilometre | 'KMT' | |
SquareMetre | 'MTK' | |
CubicMetre | 'MTQ' | |
Millilitre | 'MLT' | |
Litre | 'LTR' | |
KilowattHour | 'KWH' | |
Kilowatt | 'KWT' | |
Percent | 'P1' | |
ServiceUnit | 'E48' | |
Package | 'XPK' | |
Box | 'XBX' | |
Pallet | 'XPX' |
Methods#
| Method | Description |
|---|---|
::isValidCode() | Whether a raw code value is valid according to the official code list. |
->label() | |
::labelGroup() |
isValidCode()#
public static function isValidCode(string $code): boolWhether a raw code value is valid according to the official code list.
| Parameter | Type | Description |
|---|---|---|
$code | string |
- Returns
bool
label()#
public function label(?string $locale = null): string| Parameter | Type | Description |
|---|---|---|
$locale | ?string = null |
- Returns
string
labelGroup()#
public static function labelGroup(): string- Returns
string