@onzag/itemize / Modules / base/Root/Module/ItemDefinition/PropertiesValueMappingDefiniton / default
base/Root/Module/ItemDefinition/PropertiesValueMappingDefiniton.default
This class provides the utility for the properties that are set to a specific item, for example let's say there's an item named Vehicle, which can have a property for it being type "car", "motorbike, or "moped"; such vehicle has a wheelset, and this wheelset has properties of its own
{ "definition": "wheelset", "enforcedProperties" : { "amount": { "exactValue": 4 }, "type": { "exactValue": "car" }, }, },
represents a list of properties for an specific item named wheelset, this is a PropertiesValueMappingDefiniton
• new default(rawJSON, parentItemDefinition, referredItemDefinition): default
Contructor for the class
| Name | Type | Description |
|---|---|---|
rawJSON |
IPropertiesValueMappingDefinitonRawJSONDataType |
the raw data as JSON |
parentItemDefinition |
default |
the item definition that this node is located, its root; for the example above that would be the vehicle item definition |
referredItemDefinition |
default |
the item definition that these properties are attempted to be set against, for the example above that would be the wheelset item definition |
base/Root/Module/ItemDefinition/PropertiesValueMappingDefiniton/index.ts:65
• parentItemDefinition: default
base/Root/Module/ItemDefinition/PropertiesValueMappingDefiniton/index.ts:53
• rawData: IPropertiesValueMappingDefinitonRawJSONDataType
base/Root/Module/ItemDefinition/PropertiesValueMappingDefiniton/index.ts:51
• referredItemDefinition: default
base/Root/Module/ItemDefinition/PropertiesValueMappingDefiniton/index.ts:52
▸ getPropertyMap(): { id: string ; value: PropertyDefinitionSupportedType | default }[]
Gives a property map in the form id and value for properties
{ id: string ; value: PropertyDefinitionSupportedType | default }[]
the property map with property values
base/Root/Module/ItemDefinition/PropertiesValueMappingDefiniton/index.ts:79
▸ getPropertyValue(key): PropertyDefinitionSupportedType | default
Retrieves a property value for a given property id
| Name | Type | Description |
|---|---|---|
key |
string |
the property id |
PropertyDefinitionSupportedType | default
either a peroperty supported value or a property definition itself for referred properties
base/Root/Module/ItemDefinition/PropertiesValueMappingDefiniton/index.ts:108
▸ hasPropertyValue(key): boolean
Checks whether it contains a property value for a specific property id
| Name | Type | Description |
|---|---|---|
key |
string |
the property id |
boolean
a boolean on whether it has such a property value
base/Root/Module/ItemDefinition/PropertiesValueMappingDefiniton/index.ts:97