ShopBuilder

Contracts

Widget

Contract for content widgets

Namespace

Plenty\Modules\ShopBuilder\Contracts

Methods

public getPreview(array $widgetSettings = [], array $children = []):string

Get the html representation of the widget

Parameters
array $widgetSettings
array $children
public render(array $widgetSettings = [], array $children = []):string

Render the widget

Parameters
array $widgetSettings
array $children

ContentLinkRepositoryContract

Get, create, delete and update links between shop builder contents and layout containers.

Namespace

Plenty\Modules\ShopBuilder\Contracts

Methods

public getContentLinks(int $pluginSetId):array

Get all linked contents for a plugin set

Parameters
int $pluginSetId
public getContentLink(int $contentLinkId):ContentLink

Get a single connection between a content and a layout container

Parameters
int $contentLinkId
public createContentLink($data):ContentLink

Link a content to a layout container

Parameters
$data
public updateContentLink(int $contentLinkId, array $data):ContentLink

Update a link between a content and a layout container

Parameters
int $contentLinkId
array $data
public deleteContentLink(int $contentLinkId):void

Unlink a content from a layout container. The content itself will remain

Parameters
int $contentLinkId
public getContentLinksForContainer(string $containerName, int $pluginSetId = null, string $lang = null):void

Get all content links for a specific layout container.

Parameters
string $containerName The name of the layout container to get content links for.
int $pluginSetId An id of a plugin set to get content links for. Active plugin set will be used by default.
string $lang The language to get content links for. Current language will be get from session if not defined.

ContentPreset

Contract for content presets

Namespace

Plenty\Modules\ShopBuilder\Contracts

Methods

public getWidgets():void

Get the widget configurations of the presets to be assigned to the created content.

ContentRepositoryContract

Get, create, delete und update shop builder contents.

Namespace

Plenty\Modules\ShopBuilder\Contracts

Methods

public getContents():array

Get all contents to be edited in the shop builder.

public searchContents(int $itemsPerPage = 20, int $page = 1, array $params = []):PaginatedResult

Search for contents

Parameters
int $itemsPerPage Maximum number of items to be returned on each page
int $page Current page
array $params Search parameters
public getContent(int $contentId, int $pluginSetId, string $frontendLanguage = null):Content

Get a single content.

Parameters
int $contentId Id of the content to get information for
int $pluginSetId Plugin set id to be used for rendering widgets.
string $frontendLanguage The language to be used for rendering the widgets.
public createContent(int $pluginSetId, $data, string $frontendLanguage = null):Content

Create new content. New content will not be linked to any layout container.

Parameters
int $pluginSetId The plugin set to be used to render the content. The raw content data are not depending on a plugin set.
$data The raw content data.
string $frontendLanguage The language to be used for rendering the widgets.
public updateContent(int $pluginSetId, int $contentId, $data, string $frontendLanguage = null):Content

Update content.

Parameters
int $pluginSetId The plugin set to be used to render the content. The raw content data are not depending on a plugin set.
int $contentId The id of the content to be updated.
$data The raw data of the content.
string $frontendLanguage The language to be used for rendering the widgets.
public deleteContent(int $pluginSetId, int $contentId):void

Delete content. Any connections to layout containers will be removed too.

Parameters
int $pluginSetId The plugin set to be used to render the content. The raw content data are not depending on a plugin set.
int $contentId The id of the content to be deleted.

Models

ContentWidget

Content widget provided by a frontend plugin

Namespace

Plenty\Modules\ShopBuilder\Models

Properties

Type Name Description
string identifier The identifier of the content widget
string widgetClass The class of the content widget
string label The label of the content widget
string tooltip The tooltip of the content widget
string previewImageURL The preview image the content widget
string type The type of the widget
array allowedNestingTypes Allowed types to be nested inside this widget
settings The settings of the content widget

Methods

public toArray()

Returns this model as an array.

ContentPageDropzone

Layout container of a content page where to display link contents generated by the shop builder.

Namespace

Plenty\Modules\ShopBuilder\Models

Properties

Type Name Description
string container The container where dropped contents should be linked to.
string type The type of contents which can be linked to this dropzone.

Methods

public toArray()

Returns this model as an array.

ContentWidgetPreview

The rendered preview of a content widget

Namespace

Plenty\Modules\ShopBuilder\Models

Properties

Type Name Description
string identifier
string content

Methods

public toArray()

Returns this model as an array.

Content

Content created by the shop builder. May be linked to layout containers.

Namespace

Plenty\Modules\ShopBuilder\Models

Properties

Type Name Description
int id The ID of the content
string dataProviderName The name of the data provider
createdAt The date when the content was created
updatedAt The date when the content was last updated
string type The type of the content
widgets The configured widgets of the content
ContentLink link

Methods

public toArray()

Returns this model as an array.

ContentPage

A content page provided by a frontend plugin.

Namespace

Plenty\Modules\ShopBuilder\Models

Properties

Type Name Description
string identifier The identifier of the content page
string caption Translation key to read the caption from
array dropzones Available dropzones of this page to put contents into.

Methods

public toArray()

Returns this model as an array.

ContentLink

Links a content from the shop builder to a layout container of the frontend plugin.

Namespace

Plenty\Modules\ShopBuilder\Models

Properties

Type Name Description
int id The ID of the content link
int contentId The ID of the content
string containerName The name of the container
int pluginSetId The Id of the plugin set
string language The language where the content is linked to.
bool active Indicates if the link is active and the content should be visible for the frontend.
createdAt The date when the content was created
updatedAt The date when the content was last updated
Content content

Methods

public toArray()

Returns this model as an array.