Oihana PHP System

HasPhysicalMeasures

Provides what an entry weighs and the space it takes up.

The two travel together and are read the same way, so they are declared once rather than once per composing class : a plain number when the unit is implicit, a QuantitativeValue when it is stated ({ value: 537.6, unitCode: "KGM" }) ; an array is hydrated as the latter and sits there until it is — the constructor assigns raw, #[HydrateAs] acting through Reflection::hydrate() alone.

On a line, the pair says what the line weighs and what it occupies : the quantity multiplied by what the unit it is counted in weighs and occupies. Summed over the lines, it gives the document's own values — see BusinessDocument::$weight, which states the conventions in full and stays outside this trait : its two docblocks carry a header-level argument — why neither value belongs to the monetary totals — that a line cannot make.

Composed by the document lines : BusinessDocumentLine, DeliveryLine and GoodsReceiptLine. The companion property name constants live next to each of them, in its own constants trait, exactly as HasColor describes.

Tags
author

Marc Alcaraz (eKameleon)

since
1.4.0

Table of Contents

Properties

$volume  : null|array<string|int, mixed>|int|float|QuantitativeValue
The space this entry takes up.
$weight  : null|array<string|int, mixed>|int|float|QuantitativeValue|Mass
What this entry weighs.

Properties

$volume

The space this entry takes up.

public null|array<string|int, mixed>|int|float|QuantitativeValue $volume

The twin of HasPhysicalMeasures::$weight, and read the same way : a plain number when the unit is implicit, a QuantitativeValue when it is stated ({ value: 1.403, unitCode: "MTQ" }) ; an array is hydrated as the latter and sits there until it is.

On a line, the quantity multiplied by what the unit it is counted in occupies. Summed over the lines, it gives the document's own volume.

Tags
since
1.4.0
Attributes
#[HydrateAs]
\org\schema\QuantitativeValue::class

$weight

What this entry weighs.

public null|array<string|int, mixed>|int|float|QuantitativeValue|Mass $weight

On a line, the quantity multiplied by what the unit it is counted in weighs. Summed over the lines, it gives the document's own weight.

A plain number carries it when the unit is implicit, a QuantitativeValue when the unit is stated ({ value: 537.6, unitCode: "KGM" }) ; an array is hydrated as the latter. The same union as BusinessDocument::$weight, so a weight reads the same wherever it is met.

Deliberately neutral about gross and net. Should the distinction ever be needed, it belongs to the additionalType of a QuantitativeValue, never to a second property — two weights held in parallel eventually disagree.

Tags
since
1.4.0
Attributes
#[HydrateAs]
\org\schema\QuantitativeValue::class
On this page

Search results