Oihana PHP Standards

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
see
https://unece.org/trade/uncefact/cl-recommendations

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

$CODES  : array<string|int, mixed>|null
$SYMBOLS  : array<string|int, mixed>|null

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

CUBIC_CENTIMETER

public string CUBIC_CENTIMETER = 'Cubic Centimeter'

CUBIC_DECIMETER

public string CUBIC_DECIMETER = 'Cubic Decimeter'

CUBIC_METER

public string CUBIC_METER = 'Cubic Meter'

FAHRENHEIT

public string FAHRENHEIT = 'Degree Fahrenheit'

IMPERIAL_GALLON

public string IMPERIAL_GALLON = 'Imperial Gallon'

KILOCALORIE

public string KILOCALORIE = 'Kilocalorie'

KILOGRAM_PER_CUBIC_METER

public string KILOGRAM_PER_CUBIC_METER = 'Kilogram per cubic metre'

KILOWATT_HOUR

public string KILOWATT_HOUR = 'Kilowatt-Hour'

PARTS_PER_MILLION

public string PARTS_PER_MILLION = 'Parts Per Million'

PER_THOUSAND

public string PER_THOUSAND = 'Per Thousand'

POUND_FORCE

public string POUND_FORCE = 'Pound-force'

POUND_PER_SQUARE_INCH

public string POUND_PER_SQUARE_INCH = 'Pound per Square Inch'

REVOLUTION_PER_MINUTE

public string REVOLUTION_PER_MINUTE = 'Revolution per Minute'

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'

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
On this page

Search results