We’re sorry but this documentation section is outdated. Please have that in mind when trying to use it. You can help us making documentation up to date via Sylius Github. Thank you!
Every attribute is represented by the Attribute model which by default has the following properties:
|id||Unique id of the attribute|
|type||Attribute’s type (‘text’ by default)|
|validation||Attribute’s validation configuration|
|values||Collection of attribute values|
|storageType||Defines how attribute value should be stored in database|
|createdAt||Date when attribute was created|
|updatedAt||Date of last attribute update|
For more detailed information go to Sylius API Attribute.
Attribute’s type is an alias of AttributeType service.
This model binds the subject and the attribute, it is used to store the value of the attribute for the subject. It has the following properties:
|id||Unique id of the attribute value|
|subject||Reference to attribute’s subject|
|attribute||Reference to an attribute|
|value||Attribute’s value (not mapped)|
|text||Value of attribute stored as text|
|boolean||Value of attribute stored as boolean|
|integer||Value of attribute stored as integer|
|float||Value of attribute stored as float|
|datetime||Value of attribute stored as datetime|
|date||Value of attribute stored as date|
Value property is used only as proxy, that stores data in proper field. It’s crucial to set attribute value in field, that is mapped as attribute’s storage type.
The attribute’s name for different locales is represented by the AttributeTranslation model which has the following properties:
|id||Unique id of the attribute translation|
|name||Attribute’s name for given locale|