Plentymarkets interface documentation

Plugin

Contracts

ConfigurationRepositoryContract

Save config values for plugins

Namespace

Plenty\Modules\Plugin\Contracts

Methods
public saveConfiguration($pluginId, $configMap, $setId = null, $resetCache = true):array
Parameters

Name

Type

Description

$pluginId

int

$configMap

array

$setId

int

$resetCache

bool

public copyToPluginSetEntry($configurationOrId, $pluginSetEntryOrId):int
Parameters

Name

Type

Description

$configurationOrId

$pluginSetEntryOrId

public getConfigurationFile($pluginId, $setId):string
Parameters

Name

Type

Description

$pluginId

int

$setId

int

public export($setId, $pluginId = null, $active = null):array
Parameters

Name

Type

Description

$setId

int

$pluginId

int

$active

bool

public import($setId, $data, $pluginId = null):void
Parameters

Name

Type

Description

$setId

int

$data

array

$pluginId

int

PluginLayoutContainerRepositoryContract

Plugin layout container

Namespace

Plenty\Modules\Plugin\Contracts

Methods
public all($pluginSetId):void
Parameters

Name

Type

Description

$pluginSetId

int

public updateAll($dataList, $pluginSetId, $pluginId = null):void
Parameters

Name

Type

Description

$dataList

array

$pluginSetId

int

$pluginId

int

public getActiveLinkedLayoutContainers($activeContainerKeysList, $activeDataProviderKeysList, $pluginSetId = null):void
Parameters

Name

Type

Description

$activeContainerKeysList

array

$activeDataProviderKeysList

array

$pluginSetId

int

public getActiveLinkedLayoutContainersByPluginSetId($activeContainerKeysList, $activeDataProviderKeysList, $pluginSetId):void
Parameters

Name

Type

Description

$activeContainerKeysList

array

$activeDataProviderKeysList

array

$pluginSetId

int

public addNew($dataList, $pluginSetId):void
Parameters

Name

Type

Description

$dataList

array

$pluginSetId

int

public addOne($pluginSetId, $containerKey, $dataProviderKey, $containerPluginId = null, $dataProviderPluginId = null):void
Parameters

Name

Type

Description

$pluginSetId

int

$containerKey

string

$dataProviderKey

string

$containerPluginId

int

$dataProviderPluginId

int

public removeOne($pluginSetId, $containerKey, $dataProviderKey, $containerPluginId = null, $dataProviderPluginId = null):void
Parameters

Name

Type

Description

$pluginSetId

int

$containerKey

string

$dataProviderKey

string

$containerPluginId

int

$dataProviderPluginId

int

public exportByPluginSetId($pluginSetOrId):array
Parameters

Name

Type

Description

$pluginSetOrId

public importByPluginSetId($pluginSetOrId, $containers):void
Parameters

Name

Type

Description

$pluginSetOrId

$containers

array

PluginRepositoryContract

Search plugins according to parameters

Namespace

Plenty\Modules\Plugin\Contracts

Methods
public getPluginByName($name):Plenty\Modules\Plugin\Models\Plugin
Return type: Plugin
Parameters

Name

Type

Description

$name

string

public searchPlugins($params = [], $itemsPerPage = \Plenty\Modules\Plugin\Models\Plugin::DEFAULT_ITEMS_PER_PAGE):Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult

Search plugins using filters. Example: searchPlugins(['name' => 'PluginIWantToFind'])

Parameters

Name

Type

Description

$params

array

$itemsPerPage

int

public getPluginSets($pluginId):array
Parameters

Name

Type

Description

$pluginId

int

public isActiveInPluginSet($pluginId, $pluginSetIdOrPluginSet):bool
Parameters

Name

Type

Description

$pluginId

int

$pluginSetIdOrPluginSet

public isActiveInPluginSetByName($pluginName, $pluginSetId):bool
Parameters

Name

Type

Description

$pluginName

string

$pluginSetId

int

public isActiveInWebstore($pluginId, $webstoreId):bool
Parameters

Name

Type

Description

$pluginId

int

$webstoreId

int

public isActiveInWebstoreByPluginName($pluginName, $webstoreId):bool
Parameters

Name

Type

Description

$pluginName

string

$webstoreId

int

public decoratePlugin($plugin, $pluginSetId = null):Plenty\Modules\Plugin\Models\Plugin
Return type: Plugin
Parameters

Name

Type

Description

$plugin

Plugin

$pluginSetId

int

public installMarketplacePluginByItemId($marketplacePluginItemId, $pluginSetId = null):void
Parameters

Name

Type

Description

$marketplacePluginItemId

int

$pluginSetId

int

Events

AfterBuildPlugins

Event after plugin build has finished

Namespace

Plenty\Modules\Plugin\Events

Methods
public getPluginSet():Plenty\Modules\Plugin\PluginSet\Models\PluginSet
Return type: PluginSet

Get the plugin set which have been built

public sourceHasChanged($pluginName):bool

Check if php files of a plugin have been changed

Parameters

Name

Type

Description

$pluginName

string

public resourcesHasChanged($pluginName):bool

Check if resource files of a plugin have been changed

Parameters

Name

Type

Description

$pluginName

string

public broadcastAs():void
public broadcastPayload():void
public getWebstoreId():void
public broadcastWhen():void
public broadcastConnections():void
public broadcastOn():void
public broadcastWith():void

AfterCodeUpdate

Event after a plugin file was updated.

Namespace

Plenty\Modules\Plugin\Events

Methods
public getPluginSetId():int
public getPluginId():int

CopyPluginSet

Event after copy pluginSet has finished

Namespace

Plenty\Modules\Plugin\Events

Methods
public getSourcePluginSetId():int
public getTargetPluginSetId():int

LoadSitemapPattern

LoadSitemapPatternEvent

Namespace

Plenty\Modules\Plugin\Events

PluginSendMail

PluginSendMail

Namespace

Plenty\Modules\Plugin\Events

Methods
public getTemplate():void
public getContactEmail():void
public getCallFunction():void
public getWebstoreId():void

Models

InstalledPlugins

Model representing an installed Plugin

Namespace

Plenty\Modules\Plugin\Models

Properties
Name Type Description

id

int

The ID of the installed plugin instance

variationId

int

The variationId of the installed version

itemId

int

The id of the installed plugin

removed

bool

Whether this version of the plugin has been removed by the customer

lastUpdateChecksum

string

checksum of last installed plugin code

Methods
public toArray()

Returns this model as an array.

Plugin

Eloquent model representing a Plugin.

Namespace

Plenty\Modules\Plugin\Models

Properties
Name Type Description

id

int

The ID of the plugin

name

string

The name of the plugin

position

int

The position of the plugin. The position is used to determine the plugin order.

activeStage

bool

Shows whether the plugin is active in Stage. Inactive plugins will not be provisioned in Stage.

activeProductive

bool

Shows whether the plugin is active in Productive. Inactive plugins will not be provisioned in Productive.

created_at

string

The date that the plugin was created.

updated_at

string

The date that the plugin was updated last.

inStage

bool

Shows whether the plugin is provisioned in Stage.

inProductive

bool

Shows whether the plugin is provisioned in Productive.

isConnectedWithGit

bool

updateInformation

array

type

string

The type of the plugin. The following plugin types are available: <ul> <li>Template</li> <li>Export</li> </ul>

installed

bool

Whether or not the plugin is installed. This will be false for plugins that have been purchased from the marketplace but have not yet been installed in any set.

version

string

The version of the plugin

versionStage

string

The version of the plugin in stage

versionProductive

string

The version of the plugin in productive

marketplaceVariations

array

A list of available marketplace versions

description

string

The description text of the plugin

namespace

string

The namespace of the plugin

dependencies

array

A list of plugins with dependencies to the plugin

author

string

The name of the plugin author

price

float

The price of the plugin

keywords

array

A list of plugin keywords

require

array

A list of plugins that are required by the plugin

platform

array

Details about what platform does the plugin support.

notInstalledRequirements

array

A list of required plugins that are not installed

notActiveStageRequirements

array

A list of required plugins that are not active in stage

notActiveProductiveRequirements

array

A list of required plugins that are not active in productive

serviceProvider

string

The class name of the service provider

runOnBuild

array

The list of classes to execute once on plugin build

checkOnBuild

array

The list of classes to execute on every plugin build

pluginPath

string

The plugin path

authorIcon

string

The author icon

pluginIcon

string

The plugin icon

license

string

The plugin license

shortDescription

array

isClosedSource

bool

is closed source

inboxPath

string

path in the inbox (closed source, open source)

marketplaceName

array

The plugin name displayed in marketplace

source

string

Whether this plugin was installed from marketplace, git or local

javaScriptFiles

array

A list of included javascript files

containers

array

A list of provided containers with name and description

dataProviders

array

A list of data providers with name and description

categories

array

webhookUrl

string

webhookUrl

isExternalTool

bool

is external tool

directDownloadLinks

array

A list of urls for the external tool

forwardLink

string

A forward link to the external tool developers page

branch

string

The branch to checkout for this particular Plugin

commit

string

The commit to checkout for this particular Plugin

subscriptionInformation

array

A list if subscription informations

offerTrial

bool

Determines if the plugin offers a trial period for plentyMarketplace

offerFreemium

bool

Determines if the plugin offers freemium functionality

configurations

array

A list of plugin configuration items

webstores

array

A list of clients (stores) activated for the plugin

linkedDataProviders

array

A list of dataProviders linked with a container of this plugin

linkedContainers

array

A list of containers linked with a data provider of this plugin

repository

Git

installedPlugins

InstalledPlugins

pluginSetIds

array

Array of PluginSet Ids where this plugin is contained.

pluginSetEntries

array

A list of PluginSetEntries this plugin is linked to

pluginSetEntriesWithTrashed

array

A list of PluginSetEntries this plugin is linked to, including trashed entries

Methods
public toArray()

Returns this model as an array.

Services

PluginSendMailService

The PluginSendMailService send mails in plugins

Namespace

Plenty\Modules\Plugin\Services

Methods
public static getInstance($webstoreId):void
Parameters

Name

Type

Description

$webstoreId

public sendMail($url, $template = &quot;&quot;, $email = &quot;&quot;, $callFunction = &quot;&quot;, $webstoreId = null):bool
Parameters

Name

Type

Description

$url

string

$template

string

$email

string

$callFunction

string

$webstoreId

int

public getStatus():bool
public setStatus($status):void
Parameters

Name

Type

Description

$status

bool

public isInitialized():bool
public setInitialized($initialized):void
Parameters

Name

Type

Description

$initialized

bool

public getEmailPlaceholder():array
public addEmailPlaceholder($placeholder, $value):void
Parameters

Name

Type

Description

$placeholder

string

$value

string

public setEmailPlaceholder($emailPlaceholder):void
Parameters

Name

Type

Description

$emailPlaceholder

array

public getEmailPlaceholderKey($key, $default = &quot;&quot;):string
Parameters

Name

Type

Description

$key

string

$default

string

PluginSeoSitemapService

The PluginSeoSitemapService collect the sitemap patterns.

Namespace

Plenty\Modules\Plugin\Services

Methods
public loadPatterns($url):bool
Parameters

Name

Type

Description

$url

string

public getPatterns():array
public setItemPattern($pattern):void
Parameters

Name

Type

Description

$pattern

array

public setBlogPattern($pattern):void
Parameters

Name

Type

Description

$pattern

array

public setBlogContent($data):void
Parameters

Name

Type

Description

$data

array

public setContentCategoryPattern($pattern):void
Parameters

Name

Type

Description

$pattern

array

public setItemCategoryPattern($pattern):void
Parameters

Name

Type

Description

$pattern

array

public getItemPattern():string
public getBlogPattern():string
public getBlogContent():array
public getItemCategoryPattern():string
public getContentCategoryPattern():string

DataBase

Annotations

Index

Namespace

Plenty\Modules\Plugin\DataBase\Annotations

Methods
public toArray()

Returns this model as an array.

NonTableAttribute

Namespace

Plenty\Modules\Plugin\DataBase\Annotations

Methods
public toArray()

Returns this model as an array.

Nullable

Namespace

Plenty\Modules\Plugin\DataBase\Annotations

Methods
public toArray()

Returns this model as an array.

Relation

Namespace

Plenty\Modules\Plugin\DataBase\Annotations

Methods
public toArray()

Returns this model as an array.

Contracts

CriteriaQuery

database query

Namespace

Plenty\Modules\Plugin\DataBase\Contracts

Methods
public where($fieldName, $operator = null, $value = null):Plenty\Modules\Plugin\DataBase\Contracts\CriteriaQuery
Return type: CriteriaQuery

Add a basic where clause to the query.

Parameters

Name

Type

Description

$fieldName

string

$operator

string

$value

public whereIn($fieldName, $values, $boolean = &quot;and&quot;, $not = false):Plenty\Modules\Plugin\DataBase\Contracts\CriteriaQuery
Return type: CriteriaQuery

Add a "where in" clause to the query.

Parameters

Name

Type

Description

$fieldName

string

$values

array

$boolean

string

$not

bool

public orWhereIn($fieldName, $values):Plenty\Modules\Plugin\DataBase\Contracts\CriteriaQuery
Return type: CriteriaQuery

Add an "or where in" clause to the query.

Parameters

Name

Type

Description

$fieldName

string

$values

array

public orWhere($fieldName, $operator = null, $value = null):Plenty\Modules\Plugin\DataBase\Contracts\CriteriaQuery
Return type: CriteriaQuery

Add an "or where" clause to the query.

Parameters

Name

Type

Description

$fieldName

string

$operator

string

$value

public whereNull($fieldName, $boolean = &quot;and&quot;, $not = false):Plenty\Modules\Plugin\DataBase\Contracts\CriteriaQuery
Return type: CriteriaQuery

Add a "where null" clause to the query.

Parameters

Name

Type

Description

$fieldName

string

$boolean

string

$not

bool

public orWhereNull($fieldName):void

Add an "or where null" clause to the query.

Parameters

Name

Type

Description

$fieldName

string

public having($fieldName, $operator = null, $value = null, $boolean = &quot;and&quot;):Plenty\Modules\Plugin\DataBase\Contracts\CriteriaQuery
Return type: CriteriaQuery

Add a "having" clause to the query.

Parameters

Name

Type

Description

$fieldName

string

$operator

string

$value

string

$boolean

string

public orHaving($fieldName, $operator = null, $value = null):void

Add a "or having" clause to the query.

Parameters

Name

Type

Description

$fieldName

string

$operator

string

$value

string

public whereHas($modelName, $callback = null, $operator = &quot;&gt;=&quot;, $count = 1):void
Parameters

Name

Type

Description

$modelName

string

$callback

$operator

string

$count

int

public join($firstModelName, $callback, $as = &quot;&quot;):void

Add a join clause to the query.

Parameters

Name

Type

Description

$firstModelName

string

$callback

$as

string

public leftJoin($firstModelName, $callback):void

Add a left join to the query.

Parameters

Name

Type

Description

$firstModelName

string

$callback

DataBase

Database contract

Namespace

Plenty\Modules\Plugin\DataBase\Contracts

Methods
public save($model):Plenty\Modules\Plugin\DataBase\Contracts\Model
Return type: Model
Parameters

Name

Type

Description

$model

Model

public find($modelClassName, $primaryKeyFieldValue):Plenty\Modules\Plugin\DataBase\Contracts\Model
Return type: Model
Parameters

Name

Type

Description

$modelClassName

string

$primaryKeyFieldValue

public query($modelClassName):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query
Parameters

Name

Type

Description

$modelClassName

string

public delete($model):bool
Parameters

Name

Type

Description

$model

Model

JoinClauseQuery

database join query

Namespace

Plenty\Modules\Plugin\DataBase\Contracts

Methods
public on($firstModelName, $first, $operator = null, $secondModelName = null, $second = null, $boolean = &quot;and&quot;):Plenty\Modules\Plugin\DataBase\Contracts\JoinClauseQuery
Return type: JoinClauseQuery
Parameters

Name

Type

Description

$firstModelName

string

$first

$operator

string

$secondModelName

string

$second

string

$boolean

string

public where($modelName, $column, $operator = null, $value = null, $boolean = &quot;and&quot;):Plenty\Modules\Plugin\DataBase\Contracts\JoinClauseQuery
Return type: JoinClauseQuery

Add a basic where clause to the query.

Parameters

Name

Type

Description

$modelName

string

$column

$operator

string

$value

$boolean

string

public orWhere($modelName, $column, $operator = null, $value = null):Plenty\Modules\Plugin\DataBase\Contracts\JoinClauseQuery
Return type: JoinClauseQuery

Add an "or where" clause to the query.

Parameters

Name

Type

Description

$modelName

string

$column

$operator

string

$value

public whereNull($modelName, $column, $boolean = &quot;and&quot;, $not = false):Plenty\Modules\Plugin\DataBase\Contracts\JoinClauseQuery
Return type: JoinClauseQuery

Add a "where null" clause to the query.

Parameters

Name

Type

Description

$modelName

string

$column

$boolean

string

$not

bool

public orWhereNull($modelName, $column):Plenty\Modules\Plugin\DataBase\Contracts\JoinClauseQuery
Return type: JoinClauseQuery

Add an "or where null" clause to the query.

Parameters

Name

Type

Description

$modelName

string

$column

Migrate

Migrate models

Namespace

Plenty\Modules\Plugin\DataBase\Contracts

Methods
public createTable($modelClassName):bool
Parameters

Name

Type

Description

$modelClassName

string

public updateTable($modelClassName):bool
Parameters

Name

Type

Description

$modelClassName

string

public deleteTable($modelClassName):bool
Parameters

Name

Type

Description

$modelClassName

string

Model

Database model

Namespace

Plenty\Modules\Plugin\DataBase\Contracts

Properties
Name Type Description

primaryKeyFieldName

primaryKeyFieldType

autoIncrementPrimaryKey

textFields

attributes

original

changes

casts

dates

dateFormat

mutatorCache

Methods
public getTableName():string
public attributesToArray():array

Convert the model's attributes to an array.

public getAttribute($key):void

Get an attribute from the model.

Parameters

Name

Type

Description

$key

string

public getAttributeValue($key):void

Get a plain attribute

Parameters

Name

Type

Description

$key

string

public getAttributeFromArray($key):void

Get an attribute from the $attributes array.

Parameters

Name

Type

Description

$key

string

public hasGetMutator($key):bool

Determine if a get mutator exists for an attribute.

Parameters

Name

Type

Description

$key

string

public mutateAttribute($key, $value):void

Get the value of an attribute using its mutator.

Parameters

Name

Type

Description

$key

string

$value

public mutateAttributeForArray($key, $value):void

Get the value of an attribute using its mutator for array conversion.

Parameters

Name

Type

Description

$key

string

$value

public setAttribute($key, $value):Plenty\Modules\Plugin\DataBase\Contracts\Model
Return type: Model

Set a given attribute on the model.

Parameters

Name

Type

Description

$key

string

$value

public hasSetMutator($key):bool

Determine if a set mutator exists for an attribute.

Parameters

Name

Type

Description

$key

string

public fillJsonAttribute($key, $value):Plenty\Modules\Plugin\DataBase\Contracts\Model
Return type: Model

Set a given JSON attribute on the model.

Parameters

Name

Type

Description

$key

string

$value

public fromJson($value, $asObject = false):void

Decode the given JSON back into an array or object.

Parameters

Name

Type

Description

$value

string

$asObject

bool

public fromDateTime($value):string

Convert a DateTime to a storable string.

Parameters

Name

Type

Description

$value

public getDates():array

Get the attributes that should be converted to dates.

public setDateFormat($format):Plenty\Modules\Plugin\DataBase\Contracts\Model
Return type: Model

Set the date format used by the model.

Parameters

Name

Type

Description

$format

string

public hasCast($key, $types = null):bool

Determine whether an attribute should be cast to a native type.

Parameters

Name

Type

Description

$key

string

$types

public getCasts():array

Get the casts array.

public getAttributes():array

Get all of the current attributes on the model.

public setRawAttributes($attributes, $sync = false):Plenty\Modules\Plugin\DataBase\Contracts\Model
Return type: Model

Set the array of model attributes. No checking is done.

Parameters

Name

Type

Description

$attributes

array

$sync

bool

public getOriginal($key = null, $default = null):void

Get the model's original attribute values.

Parameters

Name

Type

Description

$key

string

$default

public only($attributes):array

Get a subset of the model's attributes.

Parameters

Name

Type

Description

$attributes

public syncOriginal():Plenty\Modules\Plugin\DataBase\Contracts\Model
Return type: Model

Sync the original attributes with the current.

public syncOriginalAttribute($attribute):Plenty\Modules\Plugin\DataBase\Contracts\Model
Return type: Model

Sync a single original attribute with its current value.

Parameters

Name

Type

Description

$attribute

string

public syncChanges():Plenty\Modules\Plugin\DataBase\Contracts\Model
Return type: Model

Sync the changed attributes.

public isDirty($attributes = null):bool

Determine if the model or given attribute(s) have been modified.

Parameters

Name

Type

Description

$attributes

public isClean($attributes = null):bool

Determine if the model or given attribute(s) have remained the same.

Parameters

Name

Type

Description

$attributes

public wasChanged($attributes = null):bool

Determine if the model or given attribute(s) have been modified.

Parameters

Name

Type

Description

$attributes

public getDirty():array

Get the attributes that have been changed since last sync.

public getChanges():array

Get the attributes that were changed.

public getMutatedAttributes():array

Get the mutated attributes for a given instance.

public static cacheMutatedAttributes($class):void

Extract and cache all the mutated attributes of a class.

Parameters

Name

Type

Description

$class

string

public relationLoaded():void

Query

database query

Namespace

Plenty\Modules\Plugin\DataBase\Contracts

Methods
public select($columns = []):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Add a basic select clause to the query.

Parameters

Name

Type

Description

$columns

array

public where($fieldName, $operator = null, $value = null):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Add a basic where clause to the query.

Parameters

Name

Type

Description

$fieldName

string

$operator

string

$value

public whereIn($fieldName, $values, $boolean = &quot;and&quot;, $not = false):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Add a "where in" clause to the query.

Parameters

Name

Type

Description

$fieldName

string

$values

array

$boolean

string

$not

bool

public orWhereIn($fieldName, $values):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Add an "or where in" clause to the query.

Parameters

Name

Type

Description

$fieldName

string

$values

array

public orWhere($fieldName, $operator = null, $value = null):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Add an "or where" clause to the query.

Parameters

Name

Type

Description

$fieldName

string

$operator

string

$value

public whereNull($fieldName, $boolean = &quot;and&quot;, $not = false):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Add a "where null" clause to the query.

Parameters

Name

Type

Description

$fieldName

string

$boolean

string

$not

bool

public orWhereNull($fieldName):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Add an "or where null" clause to the query.

Parameters

Name

Type

Description

$fieldName

string

public whereBetween($column, $values, $boolean = &quot;and&quot;, $not = false):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Add a where between statement to the query.

Parameters

Name

Type

Description

$column

string

$values

array

$boolean

string

$not

bool

public whereNotBetween($column, $values, $boolean = &quot;and&quot;):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Add a where not between statement to the query.

Parameters

Name

Type

Description

$column

string

$values

array

$boolean

string

public whereDate($column, $operator, $value = null, $boolean = &quot;and&quot;):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Add a "where date" statement to the query.

Parameters

Name

Type

Description

$column

string

$operator

string

$value

$boolean

string

public whereMonth($column, $operator, $value = null, $boolean = &quot;and&quot;):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Add a "where month" statement to the query.

Parameters

Name

Type

Description

$column

string

$operator

string

$value

$boolean

string

public whereDay($column, $operator, $value = null, $boolean = &quot;and&quot;):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Add a "where day" statement to the query.

Parameters

Name

Type

Description

$column

string

$operator

string

$value

$boolean

string

public whereYear($column, $operator, $value = null, $boolean = &quot;and&quot;):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Add a "where year" statement to the query.

Parameters

Name

Type

Description

$column

string

$operator

string

$value

$boolean

string

public whereTime($column, $operator, $value = null, $boolean = &quot;and&quot;):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Add a "where time" statement to the query.

Parameters

Name

Type

Description

$column

string

$operator

string

$value

int

$boolean

string

public whereNested($callback):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Create a nested where condition

Parameters

Name

Type

Description

$callback

callable

public groupBy($groups):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Add a "group by" statement to the query.

Parameters

Name

Type

Description

$groups

public having($fieldName, $operator = null, $value = null, $boolean = &quot;and&quot;):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Add a "having" clause to the query.

Parameters

Name

Type

Description

$fieldName

string

$operator

string

$value

string

$boolean

string

public orHaving($fieldName, $operator = null, $value = null):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Add a "or having" clause to the query.

Parameters

Name

Type

Description

$fieldName

string

$operator

string

$value

string

public orderBy($fieldName, $direction = &quot;asc&quot;):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Add an "order by" clause to the query.

Parameters

Name

Type

Description

$fieldName

string

$direction

string

public forPage($page, $perPage = 15):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Set the limit and offset for a given page.

Parameters

Name

Type

Description

$page

int

$perPage

int

public count($columns = &quot;*&quot;):int

Retrieve the "count" result of the query.

Parameters

Name

Type

Description

$columns

string

public limit($value):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Set the "limit" value of the query.

Parameters

Name

Type

Description

$value

int

public offset($value):Plenty\Modules\Plugin\DataBase\Contracts\Query
Return type: Query

Set the "offset" value of the query.

Parameters

Name

Type

Description

$value

int

public getCountForPagination($columns = []):int

Get the count of the total records for the paginator.

Parameters

Name

Type

Description

$columns

array

public get():array
public delete():bool

DynamoDb

Contracts

DynamoDbRepositoryContract

AWS DynamoDb Repository (Deprecated)

Deprecated! (since 2017-06-30)

Please use Plenty\Modules\Plugin\DataBase\Contracts\DataBase instead

Namespace

Plenty\Modules\Plugin\DynamoDb\Contracts

Methods
public createTable($pluginName, $tableName, $attributeDefinitions, $keySchema, $readCapacityUnits = 3, $writeCapacityUnits = 2):bool
Deprecated! (since 2017-06-30)

Please use Plenty\Modules\Plugin\DataBase\Contracts\DataBase instead

Create a table

Parameters

Name

Type

Description

$pluginName

string

name of your plugin

$tableName

string

$attributeDefinitions

array

$keySchema

array

$readCapacityUnits

int

$writeCapacityUnits

int

public updateTable($pluginName, $tableName, $readCapacityUnits = 3, $writeCapacityUnits = 2):bool
Deprecated! (since 2017-06-30)

Please use Plenty\Modules\Plugin\DataBase\Contracts\DataBase instead

Update a table

Parameters

Name

Type

Description

$pluginName

string

name of your plugin

$tableName

string

$readCapacityUnits

int

$writeCapacityUnits

int

public putItem($pluginName, $tableName, $item):bool
Deprecated! (since 2017-06-30)

Please use Plenty\Modules\Plugin\DataBase\Contracts\DataBase instead

Add item to table

Parameters

Name

Type

Description

$pluginName

string

name of your plugin

$tableName

string

$item

array

public getItem($pluginName, $tableName, $consistentRead, $key):array
Deprecated! (since 2017-06-30)

Please use Plenty\Modules\Plugin\DataBase\Contracts\DataBase instead

Retrieving items

Parameters

Name

Type

Description

$pluginName

string

name of your plugin

$tableName

string

$consistentRead

bool

$key

array

public deleteItem($pluginName, $tableName, $key):bool
Deprecated! (since 2017-06-30)

Please use Plenty\Modules\Plugin\DataBase\Contracts\DataBase instead

Delete an item

Parameters

Name

Type

Description

$pluginName

string

name of your plugin

$tableName

string

$key

array

public deleteTable($pluginName, $tableName):bool
Deprecated! (since 2017-06-30)

Please use Plenty\Modules\Plugin\DataBase\Contracts\DataBase instead

Deleting a table

Parameters

Name

Type

Description

$pluginName

string

name of your plugin

$tableName

string

public scan($pluginName, $tableName, $returnFields = &quot;&quot;, $expressionAttributeValues = [], $filterExpression = &quot;&quot;, $limit):void
Deprecated! (since 2017-06-30)

Please use Plenty\Modules\Plugin\DataBase\Contracts\DataBase instead

A scan operation scans the entire table. You can specify filters to apply to the results to refine the values returned to you, after the complete scan. Amazon DynamoDB puts a 1MB limit on the scan (the limit applies before the results are filtered).

Parameters

Name

Type

Description

$pluginName

string

name of your plugin

$tableName

string

$returnFields

string

$expressionAttributeValues

array

$filterExpression

string

$limit

int

is taken into account when value greater than 0

Libs

Contracts

LibraryCallContract

library call

Namespace

Plenty\Modules\Plugin\Libs\Contracts

Methods
public call($libCall, $params = []):array
Parameters

Name

Type

Description

$libCall

string

$params

array

PluginSet

Contracts

PluginSetEntryRepositoryContract

get, create, update or delete plugin set entries

Namespace

Plenty\Modules\Plugin\PluginSet\Contracts

Methods
public get($idOrInstance):Plenty\Modules\Plugin\PluginSet\Models\PluginSetEntry
Return type: PluginSetEntry

Get a PluginSetEntry.

Parameters

Name

Type

Description

$idOrInstance

The Id of the PluginSetEntry to retrieve or the PluginSetEntry object itself.

public getByPluginSetIdAndPluginId($pluginSetId, $pluginId):Plenty\Modules\Plugin\PluginSet\Models\PluginSetEntry
Return type: PluginSetEntry

Get a PluginSetEntry using a PluginSetId and PluginId

Parameters

Name

Type

Description

$pluginSetId

int

The id of the PluginSet for the PluginSetEntry which should be retrieved.

$pluginId

int

The id of the Plugin for the PluginSetEntry which should be retrieved.

public create($data):Plenty\Modules\Plugin\PluginSet\Models\PluginSetEntry
Return type: PluginSetEntry

Create a set entry.

Parameters

Name

Type

Description

$data

array

Must contain a 'pluginId' field and a 'pluginSetId' field to specify which plugin should be associated with which plugin set in the newly created set entry: ['pluginId' ⇒ 5, 'pluginSetId' ⇒ 3]

public copyToPluginSet($pluginSetEntryOrId, $pluginSetOrId, $copyConfigurations):Plenty\Modules\Plugin\PluginSet\Models\PluginSetEntry
Return type: PluginSetEntry

Copy a PluginSetEntry to a PluginSet

Parameters

Name

Type

Description

$pluginSetEntryOrId

The id of the PluginSetEntry that should be copied, or the PluginSetEntry object itself

$pluginSetOrId

The id of the PluginSet the entry should be copied to, or the PluginSet object itself

$copyConfigurations

bool

true if the configurations related to the set entry should also be copied, false if not

public update($id, $data):bool

Update a PluginSetEntry. Associate a set entry with a new set, a new plugin, or both.

Parameters

Name

Type

Description

$id

int

The id of the set entry to update

$data

array

Must contain EITHER a 'pluginId' field OR a 'pluginSetId' field OR both.

public delete($what):int

Delete a PluginSetEntry

Parameters

Name

Type

Description

$what

The PluginSetEntry object to delete or a PluginSetEntry-Id

PluginSetRepositoryContract

list, create, update or delete plugin sets

Namespace

Plenty\Modules\Plugin\PluginSet\Contracts

Methods
public count():int

Count current plugin sets.

public create($data):Plenty\Modules\Plugin\PluginSet\Models\PluginSet
Return type: PluginSet

Create a plugin set. The data array has to contain a 'name' field. Throws a 'TooManyPluginSetsException' if the maximum number of sets is exceeded.

Parameters

Name

Type

Description

$data

array

The data for the newly created plugin set. Only the 'name' field is required: ['name' ⇒ 'MyNewPluginSet'].

public copy($data):Plenty\Modules\Plugin\PluginSet\Models\PluginSet
Return type: PluginSet

Copy a plugin set. All set entries from the source set will be copied into the new set.

Parameters

Name

Type

Description

$data

array

Has to contain the Id of the plugin set to copy from and the name for the new set: ['copyPluginSetId' ⇒ 12, 'name' ⇒ 'NewSetWithCopiedEntries'].

public update($id, $data):Plenty\Modules\Plugin\PluginSet\Models\PluginSet
Return type: PluginSet

Update a set. Only the 'name' field can be updated.

Parameters

Name

Type

Description

$id

int

Id of the plugin set to update

$data

array

Update data must only contain a 'name' field: ['name' ⇒ 'NewNameForMySet']

public delete($what):int

Delete a set.

Parameters

Name

Type

Description

$what

The PluginSet object to delete or a PluginSet-Id

public get($pluginSetOrId):Plenty\Modules\Plugin\PluginSet\Models\PluginSet
Return type: PluginSet

Get a plugin set.

Parameters

Name

Type

Description

$pluginSetOrId

The Id of the plugin set to retrieve from the database. If a PluginSet object is passed instead of an integer, the object is returned without change.

public list():void

List all plugin sets.

public listSetEntries($id):void

List all set entries of a plugin set.

Parameters

Name

Type

Description

$id

int

The Id of the plugin set to list the entries from.

public listWebstores($id):void

List all webstores a plugin set is related to.

Parameters

Name

Type

Description

$id

int

The Id of the set in question

public listLayoutContainers($id):void

List all LayoutContainers for a plugin set.

Parameters

Name

Type

Description

$id

int

The Id of the plugin set in question

public getOrCreatePluginSetEntry($id, $pluginId, $withTrashed = false, $resetCache = true):Plenty\Modules\Plugin\PluginSet\Models\PluginSetEntry
Return type: PluginSetEntry

Get the PluginSetEntry object containing a specific plugin for a set. If a PluginSetEntry does not exist, it will be created.

Parameters

Name

Type

Description

$id

int

The Id of the plugin set in question

$pluginId

int

The Id of the plugin in question

$withTrashed

bool

If true, deleted PluginSetEntries will be included. Default is false.

$resetCache

bool

public changePluginActiveStatusForSet($pluginSetId, $pluginId, $active):Plenty\Modules\Plugin\Models\Plugin
Return type: Plugin

Activates / deactivates a plugin for a set by trashing or restoring the respective set entry.

Parameters

Name

Type

Description

$pluginSetId

int

The id of the plugin set in question

$pluginId

int

The id of the plugin in question

$active

bool

true if the plugin should be activated for the set, false if it should be deactivated.

public removePluginFromSet($setId, $pluginId):Plenty\Modules\Plugin\Models\Plugin
Return type: Plugin
Parameters

Name

Type

Description

$setId

int

The Id of the plugin set in question

$pluginId

int

The Id of the plugin that should be removed from the set.

public createPreviewHash($setId):string

Create a preview hash for a plugin set.

Parameters

Name

Type

Description

$setId

int

The plugin set in question

public getPreviewPluginSetId($previewHash):void

Extract a plugin set id from a preview hash.

Parameters

Name

Type

Description

$previewHash

string

The preview has to extract the plugin set id from

public installGitPlugin($setId, $pluginId, $requestData):bool

Install a git-plugin into a set.

Parameters

Name

Type

Description

$setId

int

The Id of the plugin set to install the plugin into

$pluginId

int

The Id of the (git-) plugin that should be installed into the set

$requestData

array

Must contain a 'branch' field that specifies the branch that should be installed: ['branch' ⇒ 'stable']

public setPosition($setId, $pluginId, $requestData):void

Change the position of a plugin in a set

Parameters

Name

Type

Description

$setId

int

The id of the plugin set in question

$pluginId

int

The id of the plugin of which the position should be changed

$requestData

array

Must contain a 'position' field with an integer specifying the new position: ['position' ⇒ 99]

public getSyncState($pluginSetId):bool

Get the sync state, to determine if Plugins have been (de-)activated since last build.

Parameters

Name

Type

Description

$pluginSetId

int

The id of the PluginSet

public getPluginSetHash($pluginSetOrId):string
Parameters

Name

Type

Description

$pluginSetOrId

public getPluginSetIdFromHash($pluginSetHash):int
Parameters

Name

Type

Description

$pluginSetHash

string

public getCurrentPluginSetId():int

Get the PluginSetID of the currently running plugin.

Models

PluginSet

Eloquent model representing a PluginSet.

Namespace

Plenty\Modules\Plugin\PluginSet\Models

Properties
Name Type Description

id

int

hash

string

hasSuccessfulBuild

bool

parentPluginSetId

int

parentPluginSet

PluginSet

name

string

description

string

pluginSetEntries

pluginSetEntriesWithTrashed

layoutContainers

webstores

Methods
public toArray()

Returns this model as an array.

PluginSetEntry

Eloquent model representing a PluginSetEntry.

Namespace

Plenty\Modules\Plugin\PluginSet\Models

Properties
Name Type Description

id

int

pluginId

int

pluginSetId

int

plugin

Plugin

branchName

string

commit

string

position

int

isInstalledFromGit

bool

lastCodeUpdateAt

Carbon

Methods
public toArray()

Returns this model as an array.

Storage

Contracts

StorageRepositoryContract

Storage Repository

Namespace

Plenty\Modules\Plugin\Storage\Contracts

Methods
public uploadObject($pluginName, $key, $body, $publicVisible = false, $metaData = []):Plenty\Modules\Cloud\Storage\Models\StorageObject
Return type: StorageObject

Create an object with content in $body

Parameters

Name

Type

Description

$pluginName

string

name of your plugin

$key

string

e.g. myDir/x/y/z/HelloWorld.txt

$body

string

file content

$publicVisible

bool

$metaData

array

public getObject($pluginName, $key, $publicVisible = false):Plenty\Modules\Cloud\Storage\Models\StorageObject
Return type: StorageObject

Get an object

Parameters

Name

Type

Description

$pluginName

string

name of your plugin

$key

string

e.g. myDir/x/y/z/HelloWorld.txt

$publicVisible

bool

public getObjectUrl($pluginName, $key, $publicVisible = false, $minutesToExpire = 5):string

Returns the URL to an object identified by its bucket and key. The URL will be signed and set to expire at the provided time.

Parameters

Name

Type

Description

$pluginName

string

name of your plugin

$key

string

e.g. myDir/x/y/z/HelloWorld.txt

$publicVisible

bool

$minutesToExpire

int

Minutes between 1 and 15

public getObjectAsTemporaryFileResource($pluginName, $key, $publicVisible = false):string

Get local file resource of an object. Use this if it is really necessary! Using getObject is the normal and effective way.

Parameters

Name

Type

Description

$pluginName

string

name of your plugin

$key

string

e.g. myDir/x/y/z/HelloWorld.txt

$publicVisible

bool

public doesObjectExist($pluginName, $key, $publicVisible = false):bool

Checks if object exists

Parameters

Name

Type

Description

$pluginName

string

name of your plugin

$key

string

e.g. myDir/x/y/z/HelloWorld.txt

$publicVisible

bool

public deleteObject($pluginName, $key, $publicVisible = false):bool

Executes the DeleteObject operation.

Parameters

Name

Type

Description

$pluginName

string

name of your plugin

$key

string

myDir/HelloWorld.txt

$publicVisible

bool

public listObjects($pluginName, $prefix = &quot;&quot;, $limit, $startKey = &quot;&quot;, $continuationToken = &quot;&quot;, $publicVisible = false, $resultKeyWithoutPrefix = true):Plenty\Modules\Cloud\Storage\Models\StorageObjectList
Return type: StorageObjectList

Returns some or all (up to 1000) objects

Parameters

Name

Type

Description

$pluginName

string

name of your plugin

$prefix

string

Limits the response to keys that begin with the specified prefix.

$limit

int

The total number of items to return.

$startKey

string

is where you want to start listing from. $startKey can be any key in the bucket.

$continuationToken

string

indicates that the list is being continued on this bucket with a token.

$publicVisible

bool

$resultKeyWithoutPrefix

bool

public getPluginZip($pluginSetId, $pluginName):void

Get all objects of a plugin as zip file

Parameters

Name

Type

Description

$pluginSetId

int

$pluginName

string

VersionControl

Models

Git

Model holding plugin data concerning Git version control.

Namespace

Plenty\Modules\Plugin\VersionControl\Models

Properties
Name Type Description

id

int

git id

pluginId

int

plugin id

username

string

username for remote account

password

string

password for remote account

remoteUrl

string

url for remote repository

branch

string

actual selected branch

autoFetch

bool

automatically fetch from remote repository

webhookToken

string

token needed for development

createdAt

string

created timestamp

updatedAt

string

last update timestamp

plugin

Plugin

Methods
public toArray()

Returns this model as an array.