SesExternalData¶
Field Type sesexternaldatatype
uses external storage to store data. The data must be stored in the ses_externaldata
table.
Field | Type | Description |
---|---|---|
sku |
char(40) | Unique ID of the Product category (CatalogElement). |
identifier |
char(40) | ID of the Field. Constant prefix (ses ) + lower case letters from the ERP fieldsExample: VENDOR_NO --> ses_vendor_no . |
language_code |
char(8) | Language code e.g. ger-DE. |
ses_field_type |
char(20) | The data type used for this data. |
content |
longtext | Serialized data in string format. |
Create the ses_externaldata
table¶
1 2 3 4 5 6 7 8 |
|
Note
You must create one attribute in ses_externaldata
per language and product which contains the SKU itself.
For example: (sku = 1122222)
id | sku | identifier | language_code | ses_field_type | content |
11087155 | 1122222 | ses_sku_erp | ger-DE | TextLineField | a:1:{s:17:"TextLineFieldHash";a:1:{s:4:"text";s:7:"1122222";}} |
Storing data in ses_externaldata
¶
Data that is stored in the ses_externaldata
table must be either a simple datatype: int, float, boolean or a Field Type.
Data format¶
Field Types¶
The data content is stored in the database in serialized form using the toHash()
method`.
1 2 3 4 5 6 7 8 9 10 |
|
Simple data types¶
Simple data types (int, float, bool) are stored in serialized form.
1 2 3 4 5 |
|
Symfony data type¶
Symfony data type is stored in:
1 2 |
|
Note
The member attribute $text
of FieldType\SesExternalData\Value
is actually an array.
Do not assign strings to this (public) attribute, because all implementations rely on the PHP type array.
Configuration¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
Handling of sesexternaldata
in the content model data provider¶
Adding a new field in the Product Content Type¶
You can extend the Product Content Type with the sesexternaldata
Field.
Connecting to the external storage¶
If the ses_externaldata
table is filled properly with the data, you can create the connection with the appropriate product by typing the SKU.
Handling the fetched data¶
The data from sesexternaldata
is converted in the shop and an array of Field Types or simple types is returned.