UnitService
This service class contains functions related to units.
All public functions are available in the Twig template renderer.
Deprecated!
since 5.0.0 will be removed in 6.0.0 |
Namespace
IO\Services
Type | Name | Value | Description |
---|---|---|---|
|
1 |
||
|
2 |
||
|
3 |
||
|
4 |
Type | Name | Description |
---|---|---|
|
||
|
||
|
||
|
Methods
public __construct($unitNameRepository, $unitRepository)
UnitService constructor.
Type |
Name |
Description |
|
||
|
public getUnitById($unitId, $lang = "de"):UnitName
Deprecated!
since 5.0.0 will be removed in 6.0.0 |
Get the unit by id
Type |
Name |
Description |
|
An unit id |
|
|
Optional: Language to get unit for (ISO-639-1) (Default: 'de') |
public getUnitNameByKey($unitKey, $lang = null):mixed
Deprecated!
since 5.0.0 will be removed in 6.0.0 |
Get the name of an unit by it's unit key
Type |
Name |
Description |
|
A unit key |
|
|
Optional: Language of the name (ISO-639-1) (Default: The current language) |
public static isValidUnit($sUnit):bool
Deprecated!
since 5.0.0 will be removed in 6.0.0 |
Checks if the given string unit is a valid one for the PlentyDimension.
Type |
Name |
Description |
|
The unit to be checked |
public static getHTML4Unit($sUnit = "SMM"):string
Deprecated!
since 5.0.0 will be removed in 6.0.0 |
Returns HTML code for the unit ('m','cm' o'MM')
Type |
Name |
Description |
|
One of 'MTK', 'SCM', 'SMM' |
public fromMemoryCache()
public resetMemoryCache($key = null)
Type |
Name |
Description |
|