MeasureCode uses ConstantsTrait
UN/CEFACT Unit of Measure Codes Enumeration Class (Recommendation 20).
This class provides an extended selection of the most commonly used codes across various commercial and logistical contexts.
For an exhaustive list and official documentation, please consult:
Tags
Table of Contents
Constants
- ACRE : string = 'ACR'
- ACRE_FOOT : string = 'AFK'
- AMPERE : string = 'AMP'
- ANGULAR : string = 'DD'
- BAR : string = 'BAR'
- BARREL : string = 'BLL'
- BECQUEREL : string = 'BQL'
- BIT : string = 'BIT'
- BYTE : string = 'BTE'
- CALORIE : string = 'CAL'
- CARAT : string = 'CTM'
- CELSIUS : string = 'CEL'
- CENTILITRE : string = 'CLT'
- CENTIMETER : string = 'CMT'
- COULOMB : string = 'CLB'
- COUNT : string = 'CBR'
- CUBIC_CENTIMETER : string = 'CMQ'
- CUBIC_DECIMETER : string = 'DMQ'
- CUBIC_FOOT : string = 'FTQ'
- CUBIC_METER : string = 'MTQ'
- DAY : string = 'DAY'
- DECIBEL : string = 'DB'
- DOZEN : string = 'DZN'
- FAHRENHEIT : string = 'FAH'
- FARAD : string = 'FAR'
- FOOT : string = 'FOT'
- GIGABYTE : string = 'GB'
- GRAM : string = 'GRM'
- GRAY : string = 'GRY'
- GROSS : string = 'GRO'
- HECTARE : string = 'HAR'
- HECTOMETER : string = 'HMT'
- HENRY : string = 'HNH'
- HERTZ : string = 'HTZ'
- HOUR : string = 'HUR'
- HUNDRED : string = 'CEN'
- IMPERIAL_GALLON : string = 'GLI'
- INCH : string = 'INH'
- JOULE : string = 'JOU'
- KELVIN : string = 'KEL'
- KILOBYTE : string = 'KB'
- KILOCALORIE : string = 'KCC'
- KILOGRAM : string = 'KGM'
- KILOHERTZ : string = 'KHZ'
- KILOJOULE : string = 'KJO'
- KILOMETER : string = 'KMT'
- KILOWATT : string = 'KWT'
- KILOWATT_HOUR : string = 'KWH'
- LITER : string = 'LTR'
- LUMEN : string = 'LUM'
- LUX : string = 'LUX'
- MEGABYTE : string = 'MB'
- MEGAHERTZ : string = 'MHZ'
- METER : string = 'MTR'
- METRIC_TON : string = 'TNE'
- MILE : string = 'SMI'
- MILLIBAR : string = 'MBR'
- MILLIGRAM : string = 'MGM'
- MILLILITER : string = 'MLT'
- MILLIMETER : string = 'MMT'
- MINUTE : string = 'MIN'
- MONTH : string = 'MON'
- NEWTON : string = 'NEW'
- NUMBER : string = 'NMB'
- OHM : string = 'OHM'
- OUNCE : string = 'OZA'
- PAIR : string = 'PR'
- PARTS_PER_MILLION : string = 'PPM'
- PASCAL : string = 'PAL'
- PER_THOUSAND : string = 'PER'
- PERCENT : string = 'PC1'
- PIECE : string = 'PCE'
- POINT : string = 'PT'
- POUND : string = 'LBR'
- POUND_FORCE : string = 'LBF'
- POUND_PER_SQUARE_INCH : string = 'PSI'
- RADIAN : string = 'RAD'
- RATIO : string = 'RTO'
- REVOLUTION_PER_MINUTE : string = 'RPM'
- SCORE : string = 'SCO'
- SECOND : string = 'SEC'
- SIEMENS : string = 'SIE'
- SIEVERT : string = 'SVT'
- SQUARE_CENTIMETER : string = 'CMK'
- SQUARE_DECIMETER : string = 'DMK'
- SQUARE_FOOT : string = 'FTK'
- SQUARE_INCH : string = 'INK'
- SQUARE_KILOMETER : string = 'KMK'
- SQUARE_METER : string = 'MTK'
- SQUARE_MILE : string = 'SMK'
- SQUARE_MILLIMETER : string = 'MMK'
- SQUARE_YARD : string = 'YKM'
- TEN_PAIRS : string = 'DPA'
- TESLA : string = 'TSL'
- THOUSAND : string = 'THM'
- UNIT : string = 'C62'
- UNIT_OF_CAPITAL : string = 'UC'
- US_GALLON : string = 'GLD'
- VOLT : string = 'VLT'
- WATT : string = 'WTT'
- WEBER : string = 'WEB'
- WEEK : string = 'WEE'
- YARD : string = 'YRD'
- YEAR : string = 'ANN'
Properties
Methods
- getFromName() : string|null
- Returns the code with a specific unit code name.
- getFromSymbol() : string|null
- Returns the code from a specific unit code symbol.
- getName() : string|null
- Returns the official UN/CEFACT name for a given code.
- getSymbol() : string|null
- Returns the official UN/CEFACT symbol for a given code.
- resetCaches() : void
- Reset the internal cache of the static methods.
Constants
ACRE
public
string
ACRE
= 'ACR'
ACRE_FOOT
public
string
ACRE_FOOT
= 'AFK'
AMPERE
public
string
AMPERE
= 'AMP'
ANGULAR
public
string
ANGULAR
= 'DD'
BAR
public
string
BAR
= 'BAR'
BARREL
public
string
BARREL
= 'BLL'
BECQUEREL
public
string
BECQUEREL
= 'BQL'
BIT
public
string
BIT
= 'BIT'
BYTE
public
string
BYTE
= 'BTE'
CALORIE
public
string
CALORIE
= 'CAL'
CARAT
public
string
CARAT
= 'CTM'
CELSIUS
public
string
CELSIUS
= 'CEL'
CENTILITRE
public
string
CENTILITRE
= 'CLT'
CENTIMETER
public
string
CENTIMETER
= 'CMT'
COULOMB
public
string
COULOMB
= 'CLB'
COUNT
public
string
COUNT
= 'CBR'
CUBIC_CENTIMETER
public
string
CUBIC_CENTIMETER
= 'CMQ'
CUBIC_DECIMETER
public
string
CUBIC_DECIMETER
= 'DMQ'
CUBIC_FOOT
public
string
CUBIC_FOOT
= 'FTQ'
CUBIC_METER
public
string
CUBIC_METER
= 'MTQ'
DAY
public
string
DAY
= 'DAY'
DECIBEL
public
string
DECIBEL
= 'DB'
DOZEN
public
string
DOZEN
= 'DZN'
FAHRENHEIT
public
string
FAHRENHEIT
= 'FAH'
FARAD
public
string
FARAD
= 'FAR'
FOOT
public
string
FOOT
= 'FOT'
GIGABYTE
public
string
GIGABYTE
= 'GB'
GRAM
public
string
GRAM
= 'GRM'
GRAY
public
string
GRAY
= 'GRY'
GROSS
public
string
GROSS
= 'GRO'
HECTARE
public
string
HECTARE
= 'HAR'
HECTOMETER
public
string
HECTOMETER
= 'HMT'
HENRY
public
string
HENRY
= 'HNH'
HERTZ
public
string
HERTZ
= 'HTZ'
HOUR
public
string
HOUR
= 'HUR'
HUNDRED
public
string
HUNDRED
= 'CEN'
IMPERIAL_GALLON
public
string
IMPERIAL_GALLON
= 'GLI'
INCH
public
string
INCH
= 'INH'
JOULE
public
string
JOULE
= 'JOU'
KELVIN
public
string
KELVIN
= 'KEL'
KILOBYTE
public
string
KILOBYTE
= 'KB'
KILOCALORIE
public
string
KILOCALORIE
= 'KCC'
KILOGRAM
public
string
KILOGRAM
= 'KGM'
KILOHERTZ
public
string
KILOHERTZ
= 'KHZ'
KILOJOULE
public
string
KILOJOULE
= 'KJO'
KILOMETER
public
string
KILOMETER
= 'KMT'
KILOWATT
public
string
KILOWATT
= 'KWT'
KILOWATT_HOUR
public
string
KILOWATT_HOUR
= 'KWH'
LITER
public
string
LITER
= 'LTR'
LUMEN
public
string
LUMEN
= 'LUM'
LUX
public
string
LUX
= 'LUX'
MEGABYTE
public
string
MEGABYTE
= 'MB'
MEGAHERTZ
public
string
MEGAHERTZ
= 'MHZ'
METER
public
string
METER
= 'MTR'
METRIC_TON
public
string
METRIC_TON
= 'TNE'
MILE
public
string
MILE
= 'SMI'
MILLIBAR
public
string
MILLIBAR
= 'MBR'
MILLIGRAM
public
string
MILLIGRAM
= 'MGM'
MILLILITER
public
string
MILLILITER
= 'MLT'
MILLIMETER
public
string
MILLIMETER
= 'MMT'
MINUTE
public
string
MINUTE
= 'MIN'
MONTH
public
string
MONTH
= 'MON'
NEWTON
public
string
NEWTON
= 'NEW'
NUMBER
public
string
NUMBER
= 'NMB'
OHM
public
string
OHM
= 'OHM'
OUNCE
public
string
OUNCE
= 'OZA'
PAIR
public
string
PAIR
= 'PR'
PARTS_PER_MILLION
public
string
PARTS_PER_MILLION
= 'PPM'
PASCAL
public
string
PASCAL
= 'PAL'
PER_THOUSAND
public
string
PER_THOUSAND
= 'PER'
PERCENT
public
string
PERCENT
= 'PC1'
PIECE
public
string
PIECE
= 'PCE'
POINT
public
string
POINT
= 'PT'
POUND
public
string
POUND
= 'LBR'
POUND_FORCE
public
string
POUND_FORCE
= 'LBF'
POUND_PER_SQUARE_INCH
public
string
POUND_PER_SQUARE_INCH
= 'PSI'
RADIAN
public
string
RADIAN
= 'RAD'
RATIO
public
string
RATIO
= 'RTO'
REVOLUTION_PER_MINUTE
public
string
REVOLUTION_PER_MINUTE
= 'RPM'
SCORE
public
string
SCORE
= 'SCO'
SECOND
public
string
SECOND
= 'SEC'
SIEMENS
public
string
SIEMENS
= 'SIE'
SIEVERT
public
string
SIEVERT
= 'SVT'
SQUARE_CENTIMETER
public
string
SQUARE_CENTIMETER
= 'CMK'
SQUARE_DECIMETER
public
string
SQUARE_DECIMETER
= 'DMK'
SQUARE_FOOT
public
string
SQUARE_FOOT
= 'FTK'
SQUARE_INCH
public
string
SQUARE_INCH
= 'INK'
SQUARE_KILOMETER
public
string
SQUARE_KILOMETER
= 'KMK'
SQUARE_METER
public
string
SQUARE_METER
= 'MTK'
SQUARE_MILE
public
string
SQUARE_MILE
= 'SMK'
SQUARE_MILLIMETER
public
string
SQUARE_MILLIMETER
= 'MMK'
SQUARE_YARD
public
string
SQUARE_YARD
= 'YKM'
TEN_PAIRS
public
string
TEN_PAIRS
= 'DPA'
TESLA
public
string
TESLA
= 'TSL'
THOUSAND
public
string
THOUSAND
= 'THM'
UNIT
public
string
UNIT
= 'C62'
UNIT_OF_CAPITAL
public
string
UNIT_OF_CAPITAL
= 'UC'
US_GALLON
public
string
US_GALLON
= 'GLD'
VOLT
public
string
VOLT
= 'VLT'
WATT
public
string
WATT
= 'WTT'
WEBER
public
string
WEBER
= 'WEB'
WEEK
public
string
WEEK
= 'WEE'
YARD
public
string
YARD
= 'YRD'
YEAR
public
string
YEAR
= 'ANN'
Properties
$NAMES
private
static array<string|int, mixed>|null
$NAMES
= null
$SYMBOLS
private
static array<string|int, mixed>|null
$SYMBOLS
= null
Methods
getFromName()
Returns the code with a specific unit code name.
public
static getFromName(string $name) : string|null
Parameters
- $name : string
Return values
string|nullgetFromSymbol()
Returns the code from a specific unit code symbol.
public
static getFromSymbol(string $symbol) : string|null
Parameters
- $symbol : string
Return values
string|nullgetName()
Returns the official UN/CEFACT name for a given code.
public
static getName(string $code) : string|null
Parameters
- $code : string
Return values
string|null —The UN/CEFACT name or null if not found.
getSymbol()
Returns the official UN/CEFACT symbol for a given code.
public
static getSymbol(string $code) : string|null
Parameters
- $code : string
Return values
string|null —The UN/CEFACT code (e.g., 'KGM') or null if not found.
resetCaches()
Reset the internal cache of the static methods.
public
static resetCaches() : void