WidgetDataFactory

Namespace

Ceres\Widgets\Helper\Factories

Properties
Type Name Description

``

$data

Methods
public static make($identifier):WidgetDataFactory

Create a new widget factory instance.

Parameters

Type

Name

Description

string

$identifier

Unique identifier of the widget.

public withLabel($label):Factories

Set a label for this widget. Will be translated.

Parameters

Type

Name

Description

string

$label

Label of the widget to be displayed in the shop builder

public withPreviewImageUrl($previewImageUrl):Factories

Set the url of a preview image for the widget.

Parameters

Type

Name

Description

string

$previewImageUrl

public withType($type):Factories

Set the type of the widget.

Parameters

Type

Name

Description

string

$type

Type of the widget

public withCategory($category):Factories

Add a category for the widget. A widget might be assigned to multiple categories.

Parameters

Type

Name

Description

string

$category

public withPosition($position):Factories

Set the position of the widget.

Parameters

Type

Name

Description

int

$position

Position of the widget

public withMaxPerPage($maxPerPage):Factories

Limit the amount of times a widget can be placed on a content.

Parameters

Type

Name

Description

int

$maxPerPage

Maximum allowed amount of instances of the widget on a content

public withAllowedNestingTypes($allowedTypes):Factories

Limits the widget types that you can drop into this widget.

Parameters

Type

Name

Description

array

$allowedTypes

public withDeprecated():Factories

Set the widget as deprecated.

public toArray():array

Get widget data.