%ses-brand uses own fields to store ecommerce related data, e.g for the catalog or basket.
The shop provides a flexible way to store data using concrete instances of classes implementing the FieldInterface
and inheriting from the AbstractField
class. Fields are used for fixed attributes of a product/catalog and flexible attributes (property "dataMap
" in CatalogElement
).
Each instance of a concrete Field will provide the following methods:
Method | Description |
---|
getTypeIdentifier() | Returns the identifier of the Field (e.g. "sesimage") |
isSearchable() | Returns true, if the Field is searchable |
isEmptyValue() | Returns true, if the value of the Field is empty |
getEmptyValue() | Returns an empty version of the Field |
toHash() | Returns a associative array (hash) from the Field |
fromHash($hash) | Returns a created instance of the Field by associative array (hash) |
toString() | Returns the value of the Field as string |
Note |
---|
All AbstractField objects can be serialized, if you are using the methods toHash() and fromHash() before/after (un)serialize method. Code Block |
---|
| //serialize
if($field instanceof AbstractField) {
$fieldValue = serialize($field->toHash());
} |
|
Class diagram

Implemented concrete Field classes
Type | Used for | identifier |
---|
TextLineField | A simple String without HTML-Code | sestextline |
TextBlockField | A rich text field containing HTML code | sestextblock |
ImageField | An image contains a path to an image and an alternative text | sesimage |
ArrayField | A structured array | sesarray |
PriceField | An instance of the Price class | sesprice |
Used templates for rendering
For each concrete Field
a templates has to be provided in order to render the Field
in the template.
...
Code Block |
---|
{{ ses_render_field(catalogElement, 'longDescription')|raw }} |
TextLineField
Include Page |
---|
| TextLineField |
---|
| TextLineField |
---|
|
TextBlockField
Include Page |
---|
| TextBlockField |
---|
| TextBlockField |
---|
|
ImageField
ArrayField
PriceField
...