GetAdditionalPropertyTrait
Reads the values stored in the `additionalProperty` list of a schema.org thing.
The counterpart of SetAdditionalPropertyTrait, which writes them. A thing
carries these entries as a flat list of PropertyValue, each naming a
propertyID and its value — the list is the only way to know whether a
contact receives the quotes, or whether an address is the billing one.
Both shapes are honoured: the hydrated objects a schema builds, and the plain arrays a document comes back as when nothing re-hydrated it.
Tags
Table of Contents
Methods
- getAdditionalPropertyValue() : mixed
- The value stored under the given property id, or null when absent.
- hasAdditionalPropertyFlag() : bool
- Whether the given property id is stored as a true flag.
Methods
getAdditionalPropertyValue()
The value stored under the given property id, or null when absent.
public
getAdditionalPropertyValue(string $propertyID) : mixed
Parameters
- $propertyID : string
-
The
propertyIDto look for.
Return values
mixed —The stored value, or null when the thing carries no such entry.
hasAdditionalPropertyFlag()
Whether the given property id is stored as a true flag.
public
hasAdditionalPropertyFlag(string $propertyID) : bool
Tolerant on purpose: the value may come back as a real boolean, as the
string "1", or as the number 1, depending on how the thing was built.
An absent entry is false — nothing was claimed.
Parameters
- $propertyID : string
-
The
propertyIDto look for.