MeasureName uses ConstantsTrait
UN/CEFACT Unit of Measure Names Enumeration Class (Recommendation 20).
This class exposes an extended selection of the most commonly used codes across various commercial and logistical contexts.
It mirrors MeasureCode and MeasureSymbol : the three classes declare the same constant names, which is what the cross lookups rely on.
⚠️ Generated by tools/generate-uncefact-rec20.php — do not edit by hand. Edit tools/data/uncefact-rec20-selection.csv and run the generator instead.
Tags
Table of Contents
Constants
- ACRE : string = 'Acre'
- ACRE_FOOT : string = 'Acre-Foot'
- AMPERE : string = 'Ampere'
- ANGULAR : string = 'Angular Degree'
- BAR : string = 'Bar'
- BARREL : string = 'Barrel'
- BECQUEREL : string = 'Becquerel'
- BIT : string = 'Bit'
- BYTE : string = 'Byte'
- CALORIE : string = 'Calorie'
- CARAT : string = 'Carat'
- CELSIUS : string = 'Degree Celsius'
- CENTILITRE : string = 'Centilitre'
- CENTIMETER : string = 'Centimeter'
- COULOMB : string = 'Coulomb'
- CUBIC_CENTIMETER : string = 'Cubic Centimeter'
- CUBIC_DECIMETER : string = 'Cubic Decimeter'
- CUBIC_FOOT : string = 'Cubic Foot'
- CUBIC_METER : string = 'Cubic Meter'
- DAY : string = 'Day'
- DECIBEL : string = 'Decibel'
- DOZEN : string = 'Dozen'
- FAHRENHEIT : string = 'Degree Fahrenheit'
- FARAD : string = 'Farad'
- FOOT : string = 'Foot'
- GIGABYTE : string = 'Gigabyte'
- GRAM : string = 'Gram'
- GRAY : string = 'Gray'
- GROSS : string = 'Gross'
- HECTARE : string = 'Hectare'
- HECTOMETER : string = 'Hectometer'
- HENRY : string = 'Henry'
- HERTZ : string = 'Hertz'
- HOUR : string = 'Hour'
- HUNDRED : string = 'Hundred'
- IMPERIAL_GALLON : string = 'Imperial Gallon'
- INCH : string = 'Inch'
- JOULE : string = 'Joule'
- KELVIN : string = 'Kelvin'
- KILOBYTE : string = 'Kilobyte'
- KILOCALORIE : string = 'Kilocalorie'
- KILOGRAM : string = 'Kilogram'
- KILOGRAM_PER_CUBIC_METER : string = 'Kilogram per cubic metre'
- KILOHERTZ : string = 'Kilohertz'
- KILOJOULE : string = 'Kilojoule'
- KILOMETER : string = 'Kilometer'
- KILOWATT : string = 'Kilowatt'
- KILOWATT_HOUR : string = 'Kilowatt-Hour'
- LITER : string = 'Liter'
- LUMEN : string = 'Lumen'
- LUX : string = 'Lux'
- MEGABYTE : string = 'Megabyte'
- MEGAHERTZ : string = 'Megahertz'
- METER : string = 'Meter'
- METRIC_TON : string = 'Metric Ton'
- MILE : string = 'Mile'
- MILLIBAR : string = 'Millibar'
- MILLIGRAM : string = 'Milligram'
- MILLILITER : string = 'Milliliter'
- MILLIMETER : string = 'Millimeter'
- MINUTE : string = 'Minute'
- MONTH : string = 'Month'
- NEWTON : string = 'Newton'
- OHM : string = 'Ohm'
- OUNCE : string = 'Ounce'
- PAIR : string = 'Pair'
- PARTS_PER_MILLION : string = 'Parts Per Million'
- PASCAL : string = 'Pascal'
- PER_THOUSAND : string = 'Per Thousand'
- PERCENT : string = 'Percent'
- PIECE : string = 'Piece'
- POUND : string = 'Pound'
- POUND_FORCE : string = 'Pound-force'
- POUND_PER_SQUARE_INCH : string = 'Pound per Square Inch'
- RADIAN : string = 'Radian'
- REVOLUTION_PER_MINUTE : string = 'Revolution per Minute'
- SCORE : string = 'Score'
- SECOND : string = 'Second'
- SIEMENS : string = 'Siemens'
- SIEVERT : string = 'Sievert'
- SQUARE_CENTIMETER : string = 'Square Centimeter'
- SQUARE_DECIMETER : string = 'Square Decimeter'
- SQUARE_FOOT : string = 'Square Foot'
- SQUARE_INCH : string = 'Square Inch'
- SQUARE_KILOMETER : string = 'Square Kilometer'
- SQUARE_METER : string = 'Square Meter'
- SQUARE_MILE : string = 'Square Mile'
- SQUARE_MILLIMETER : string = 'Square Millimeter'
- SQUARE_YARD : string = 'Square Yard'
- TEN_PAIRS : string = 'Ten Pairs'
- TESLA : string = 'Tesla'
- THOUSAND : string = 'Thousand'
- UNIT : string = 'Unit'
- US_GALLON : string = 'US Gallon'
- VOLT : string = 'Volt'
- WATT : string = 'Watt'
- WEBER : string = 'Weber'
- WEEK : string = 'Week'
- YARD : string = 'Yard'
- YEAR : string = 'Year'
Properties
Methods
- getCode() : string|null
- Returns the official UN/CEFACT code for a given name.
- getFromCode() : string|null
- Returns the name matching a specific unit code.
- getFromSymbol() : string|null
- Returns the name matching a specific unit symbol.
- getSymbol() : string|null
- Returns the official UN/CEFACT symbol for a given name.
- resetCaches() : void
- Reset the internal cache of the static methods.
Constants
ACRE
public
string
ACRE
= 'Acre'
ACRE_FOOT
public
string
ACRE_FOOT
= 'Acre-Foot'
AMPERE
public
string
AMPERE
= 'Ampere'
ANGULAR
public
string
ANGULAR
= 'Angular Degree'
BAR
public
string
BAR
= 'Bar'
BARREL
public
string
BARREL
= 'Barrel'
BECQUEREL
public
string
BECQUEREL
= 'Becquerel'
BIT
public
string
BIT
= 'Bit'
BYTE
public
string
BYTE
= 'Byte'
CALORIE
public
string
CALORIE
= 'Calorie'
CARAT
public
string
CARAT
= 'Carat'
CELSIUS
public
string
CELSIUS
= 'Degree Celsius'
CENTILITRE
public
string
CENTILITRE
= 'Centilitre'
CENTIMETER
public
string
CENTIMETER
= 'Centimeter'
COULOMB
public
string
COULOMB
= 'Coulomb'
CUBIC_CENTIMETER
public
string
CUBIC_CENTIMETER
= 'Cubic Centimeter'
CUBIC_DECIMETER
public
string
CUBIC_DECIMETER
= 'Cubic Decimeter'
CUBIC_FOOT
public
string
CUBIC_FOOT
= 'Cubic Foot'
CUBIC_METER
public
string
CUBIC_METER
= 'Cubic Meter'
DAY
public
string
DAY
= 'Day'
DECIBEL
public
string
DECIBEL
= 'Decibel'
DOZEN
public
string
DOZEN
= 'Dozen'
FAHRENHEIT
public
string
FAHRENHEIT
= 'Degree Fahrenheit'
FARAD
public
string
FARAD
= 'Farad'
FOOT
public
string
FOOT
= 'Foot'
GIGABYTE
public
string
GIGABYTE
= 'Gigabyte'
GRAM
public
string
GRAM
= 'Gram'
GRAY
public
string
GRAY
= 'Gray'
GROSS
public
string
GROSS
= 'Gross'
HECTARE
public
string
HECTARE
= 'Hectare'
HECTOMETER
public
string
HECTOMETER
= 'Hectometer'
HENRY
public
string
HENRY
= 'Henry'
HERTZ
public
string
HERTZ
= 'Hertz'
HOUR
public
string
HOUR
= 'Hour'
HUNDRED
public
string
HUNDRED
= 'Hundred'
IMPERIAL_GALLON
public
string
IMPERIAL_GALLON
= 'Imperial Gallon'
INCH
public
string
INCH
= 'Inch'
JOULE
public
string
JOULE
= 'Joule'
KELVIN
public
string
KELVIN
= 'Kelvin'
KILOBYTE
public
string
KILOBYTE
= 'Kilobyte'
KILOCALORIE
public
string
KILOCALORIE
= 'Kilocalorie'
KILOGRAM
public
string
KILOGRAM
= 'Kilogram'
KILOGRAM_PER_CUBIC_METER
public
string
KILOGRAM_PER_CUBIC_METER
= 'Kilogram per cubic metre'
KILOHERTZ
public
string
KILOHERTZ
= 'Kilohertz'
KILOJOULE
public
string
KILOJOULE
= 'Kilojoule'
KILOMETER
public
string
KILOMETER
= 'Kilometer'
KILOWATT
public
string
KILOWATT
= 'Kilowatt'
KILOWATT_HOUR
public
string
KILOWATT_HOUR
= 'Kilowatt-Hour'
LITER
public
string
LITER
= 'Liter'
LUMEN
public
string
LUMEN
= 'Lumen'
LUX
public
string
LUX
= 'Lux'
MEGABYTE
public
string
MEGABYTE
= 'Megabyte'
MEGAHERTZ
public
string
MEGAHERTZ
= 'Megahertz'
METER
public
string
METER
= 'Meter'
METRIC_TON
public
string
METRIC_TON
= 'Metric Ton'
MILE
public
string
MILE
= 'Mile'
MILLIBAR
public
string
MILLIBAR
= 'Millibar'
MILLIGRAM
public
string
MILLIGRAM
= 'Milligram'
MILLILITER
public
string
MILLILITER
= 'Milliliter'
MILLIMETER
public
string
MILLIMETER
= 'Millimeter'
MINUTE
public
string
MINUTE
= 'Minute'
MONTH
public
string
MONTH
= 'Month'
NEWTON
public
string
NEWTON
= 'Newton'
OHM
public
string
OHM
= 'Ohm'
OUNCE
public
string
OUNCE
= 'Ounce'
PAIR
public
string
PAIR
= 'Pair'
PARTS_PER_MILLION
public
string
PARTS_PER_MILLION
= 'Parts Per Million'
PASCAL
public
string
PASCAL
= 'Pascal'
PER_THOUSAND
public
string
PER_THOUSAND
= 'Per Thousand'
PERCENT
public
string
PERCENT
= 'Percent'
PIECE
public
string
PIECE
= 'Piece'
POUND
public
string
POUND
= 'Pound'
POUND_FORCE
public
string
POUND_FORCE
= 'Pound-force'
POUND_PER_SQUARE_INCH
public
string
POUND_PER_SQUARE_INCH
= 'Pound per Square Inch'
RADIAN
public
string
RADIAN
= 'Radian'
REVOLUTION_PER_MINUTE
public
string
REVOLUTION_PER_MINUTE
= 'Revolution per Minute'
SCORE
public
string
SCORE
= 'Score'
SECOND
public
string
SECOND
= 'Second'
SIEMENS
public
string
SIEMENS
= 'Siemens'
SIEVERT
public
string
SIEVERT
= 'Sievert'
SQUARE_CENTIMETER
public
string
SQUARE_CENTIMETER
= 'Square Centimeter'
SQUARE_DECIMETER
public
string
SQUARE_DECIMETER
= 'Square Decimeter'
SQUARE_FOOT
public
string
SQUARE_FOOT
= 'Square Foot'
SQUARE_INCH
public
string
SQUARE_INCH
= 'Square Inch'
SQUARE_KILOMETER
public
string
SQUARE_KILOMETER
= 'Square Kilometer'
SQUARE_METER
public
string
SQUARE_METER
= 'Square Meter'
SQUARE_MILE
public
string
SQUARE_MILE
= 'Square Mile'
SQUARE_MILLIMETER
public
string
SQUARE_MILLIMETER
= 'Square Millimeter'
SQUARE_YARD
public
string
SQUARE_YARD
= 'Square Yard'
TEN_PAIRS
public
string
TEN_PAIRS
= 'Ten Pairs'
TESLA
public
string
TESLA
= 'Tesla'
THOUSAND
public
string
THOUSAND
= 'Thousand'
UNIT
public
string
UNIT
= 'Unit'
US_GALLON
public
string
US_GALLON
= 'US Gallon'
VOLT
public
string
VOLT
= 'Volt'
WATT
public
string
WATT
= 'Watt'
WEBER
public
string
WEBER
= 'Weber'
WEEK
public
string
WEEK
= 'Week'
YARD
public
string
YARD
= 'Yard'
YEAR
public
string
YEAR
= 'Year'
Properties
$CODES
private
static array<string|int, mixed>|null
$CODES
= null
$SYMBOLS
private
static array<string|int, mixed>|null
$SYMBOLS
= null
Methods
getCode()
Returns the official UN/CEFACT code for a given name.
public
static getCode(string $name) : string|null
Parameters
- $name : string
-
The UN/CEFACT name (e.g., 'Kilogram').
Return values
string|null —The UN/CEFACT code (e.g., 'KGM') or null if not found.
getFromCode()
Returns the name matching a specific unit code.
public
static getFromCode(string $code) : string|null
Parameters
- $code : string
-
The UN/CEFACT code (e.g., 'KGM').
Return values
string|null —The UN/CEFACT name (e.g., 'Kilogram') or null if not found.
getFromSymbol()
Returns the name matching a specific unit symbol.
public
static getFromSymbol(string $symbol) : string|null
Parameters
- $symbol : string
-
The UN/CEFACT symbol (e.g., 'kg').
Return values
string|null —The UN/CEFACT name (e.g., 'Kilogram') or null if not found.
getSymbol()
Returns the official UN/CEFACT symbol for a given name.
public
static getSymbol(string $name) : string|null
Parameters
- $name : string
-
The UN/CEFACT name (e.g., 'Kilogram').
Return values
string|null —The UN/CEFACT symbol (e.g., 'kg') or null if not found.
resetCaches()
Reset the internal cache of the static methods.
public
static resetCaches() : void