UnitBuilder
in package
Table of Contents
Properties
- $units : array<string|int, mixed>
Methods
- buildDivideUnit() : array<string|int, mixed>
- Constructs and returns a divide unit array based on the provided numerator and denominator measures.
- buildPureUnit() : array<string|int, mixed>
- Constructs and returns a pure unit array based on the 'xbrli:pure' identifier.
- buildSimpleUnit() : array<string|int, mixed>
- Builds a simple unit using the provided measure.
- getAllUnits() : array<string|int, mixed>
- Retrieves all units as an array.
- buildUnitId() : string
- Generates a unique unit identifier based on the normalized data provided.
Properties
$units
private
array<string|int, mixed>
$units
= []
Methods
buildDivideUnit()
Constructs and returns a divide unit array based on the provided numerator and denominator measures.
public
buildDivideUnit(array<string|int, mixed> $numeratorMeasures, array<string|int, mixed> $denominatorMeasures) : array<string|int, mixed>
Parameters
- $numeratorMeasures : array<string|int, mixed>
-
The measures to be used as the numerator in the divide unit.
- $denominatorMeasures : array<string|int, mixed>
-
The measures to be used as the denominator in the divide unit.
Tags
Return values
array<string|int, mixed> —The divide unit array.
buildPureUnit()
Constructs and returns a pure unit array based on the 'xbrli:pure' identifier.
public
buildPureUnit() : array<string|int, mixed>
Return values
array<string|int, mixed> —The pure unit array.
buildSimpleUnit()
Builds a simple unit using the provided measure.
public
buildSimpleUnit(string $measure) : array<string|int, mixed>
Parameters
- $measure : string
-
The unit measure to be used for building the simple unit. Must not be an empty string.
Tags
Return values
array<string|int, mixed> —An associative array representing the created simple unit, including its ID, type, and measures.
getAllUnits()
Retrieves all units as an array.
public
getAllUnits() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array containing all units.
buildUnitId()
Generates a unique unit identifier based on the normalized data provided.
private
buildUnitId(array<string|int, mixed> $normalized) : string
Parameters
- $normalized : array<string|int, mixed>
-
The normalized data array used to generate the identifier.
Return values
string —Returns a 16-character hashed string prefixed with 'u_' as the unique unit identifier.