Models¶

Danger

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!

Attribute¶

Every attribute is represented by the Attribute model which by default has the following properties:

Property Description
id Unique id of the attribute
type Attribute’s type (‘text’ by default)
name Attribute’s name
configuration Attribute’s configuration
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

Note

This model uses the TranslatableTrait and implements the AttributeInterface.

For more detailed information go to Sylius API Attribute.

Attention

Attribute’s type is an alias of AttributeType service.

AttributeValue¶

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:

Property Description
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

Attention

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.

Note

This model implements the AttributeValueInterface.

For more detailed information go to Sylius API AttributeValue.

AttributeTranslation¶

The attribute’s name for different locales is represented by the AttributeTranslation model which has the following properties:

Property Description
id Unique id of the attribute translation
name Attribute’s name for given locale

Note

This model extends the AbstractTranslation class and implements the AttributeTranslationInterface.

For more detailed information go to Sylius API AttributeTranslation.