Plugin

Contracts

ConfigurationRepositoryContract

Save config values for plugins

Namespace

Plenty\Modules\Plugin\Contracts

Methods

public saveConfiguration(int $pluginId, array $configMap, int $setId = null):array
Parameters
int $pluginId
array $configMap
int $setId

PluginRepositoryContract

Search plugins according to parameters

Namespace

Plenty\Modules\Plugin\Contracts

Methods

public searchPlugins(array $params = [], int $itemsPerPage = \Plenty\Modules\Plugin\Models\Plugin::DEFAULT_ITEMS_PER_PAGE):PaginatedResult

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

Parameters
array $params
int $itemsPerPage

Events

LoadSitemapPattern

LoadSitemapPatternEvent

Namespace

Plenty\Modules\Plugin\Events

Models

InstalledPlugins

Model representing an installed Plugin

Namespace

Plenty\Modules\Plugin\Models

Properties

Type Name Description
int id The ID of the installed plugin instance
int variationId The variationId of the installed version
int itemId The id of the installed plugin
bool removed Whether this version of the plugin has been removed by the customer
string lastUpdateChecksum 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

Type Name Description
int id The ID of the plugin
string name The name of the plugin
int position The position of the plugin. The position is used to determine the plugin order.
bool activeStage Shows whether the plugin is active in Stage. Inactive plugins will not be provisioned in Stage.
bool activeProductive Shows whether the plugin is active in Productive. Inactive plugins will not be provisioned in Productive.
string created_at The date that the plugin was created.
string updated_at The date that the plugin was updated last.
bool inStage Shows whether the plugin is provisioned in Stage.
bool inProductive Shows whether the plugin is provisioned in Productive.
bool isConnectedWithGit
array updateInformation
string type The type of the plugin. The following plugin types are available:
  • Template
  • Export
string version The version of the plugin
string versionStage The version of the plugin in stage
string versionProductive The version of the plugin in productive
string description The description text of the plugin
string namespace The namespace of the plugin
array dependencies A list of plugins with dependencies to the plugin
string author The name of the plugin author
float price The price of the plugin
array keywords A list of plugin keywords
array require A list of plugins that are required by the plugin
array notInstalledRequirements A list of required plugins that are not installed
array notActiveStageRequirements A list of required plugins that are not active in stage
array notActiveProductiveRequirements A list of required plugins that are not active in productive
string serviceProvider The class name of the service provider
array runOnBuild The list of classes to execute once on plugin build
array checkOnBuild The list of classes to execute on every plugin build
string pluginPath The plugin path
string authorIcon The author icon
string pluginIcon The plugin icon
string license The plugin license
array shortDescription
bool isClosedSource is closed source
string marketplaceName The plugin name displayed in marketplace
string source Whether this plugin was installed from marketplace, git or local
array javaScriptFiles A list of included javascript files
array containers A list of provided containers with name and description
array dataProviders A list of data providers with name and description
array categories
string webhookUrl webhookUrl
bool isExternalTool is external tool
array directDownloadLinks A list of urls for the external tool
string forwardLink A forward link to the external tool developers page
array configurations A list of plugin configuration items
array permissions A list of plugin permissions
array webstores A list of clients (stores) activated for the plugin
array linkedDataProviders A list of dataProviders linked with a container of this plugin
array linkedContainers A list of containers linked with a data provider of this plugin
Git repository
InstalledPlugins installedPlugins
array pluginSetIds Array of PluginSet Ids where this plugin is contained.
array pluginSetEntries A list of PluginSetEntries this plugin is linked to

Methods

public toArray()

Returns this model as an array.

Services

PluginSeoSitemapService

The PluginSeoSitemapService collect the sitemap patterns.

Namespace

Plenty\Modules\Plugin\Services

Methods

public loadPatterns(string $url):bool
Parameters
string $url
public getPatterns():array
public setItemPattern(array $pattern):void
Parameters
array $pattern
public setBlogPattern(array $pattern):void
Parameters
array $pattern
public setContentCategoryPattern(array $pattern):void
Parameters
array $pattern
public setItemCategoryPattern(array $pattern):void
Parameters
array $pattern
public getItemPattern():string
public getBlogPattern():string
public getItemCategoryPattern():string
public getContentCategoryPattern():string

DataBase

Annotations

Index

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(string $fieldName, string $operator = null, $value = null):Contracts

Add a basic where clause to the query.

Parameters
string $fieldName
string $operator
$value
public whereIn(string $fieldName, array $values, string $boolean = "and", bool $not = false):Contracts

Add a "where in" clause to the query.

Parameters
string $fieldName
array $values
string $boolean
bool $not
public orWhereIn(string $fieldName, array $values):Contracts

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

Parameters
string $fieldName
array $values
public orWhere(string $fieldName, string $operator = null, $value = null):Contracts

Add an "or where" clause to the query.

Parameters
string $fieldName
string $operator
$value
public whereNull(string $fieldName, string $boolean = "and", bool $not = false):Contracts

Add a "where null" clause to the query.

Parameters
string $fieldName
string $boolean
bool $not
public orWhereNull(string $fieldName):void

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

Parameters
string $fieldName
public having(string $fieldName, string $operator = null, string $value = null, string $boolean = "and"):Contracts

Add a "having" clause to the query.

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

Add a "or having" clause to the query.

Parameters
string $fieldName
string $operator
string $value
public whereHas(string $modelName, $callback = null, string $operator = ">=", int $count = 1):void
Parameters
string $modelName
$callback
string $operator
int $count
public join(string $firstModelName, $callback, string $as = ""):void

Add a join clause to the query.

Parameters
string $firstModelName
$callback
string $as
public leftJoin(string $firstModelName, $callback):void

Add a left join to the query.

Parameters
string $firstModelName
$callback

DataBase

Database contract

Namespace

Plenty\Modules\Plugin\DataBase\Contracts

Methods

public save(Model
 $model):Model
Parameters
Model $model
public find(string $modelClassName, $primaryKeyFieldValue):Model
Parameters
string $modelClassName
$primaryKeyFieldValue
public query(string $modelClassName):Query
Parameters
string $modelClassName
public delete(Model
 $model):bool
Parameters
Model $model

JoinClauseQuery

database join query

Namespace

Plenty\Modules\Plugin\DataBase\Contracts

Methods

public on(string $firstModelName, $first, string $operator = null, string $secondModelName = null, string $second = null, string $boolean = "and"):Contracts
Parameters
string $firstModelName
$first
string $operator
string $secondModelName
string $second
string $boolean
public where(string $modelName, $column, string $operator = null, $value = null, string $boolean = "and"):Contracts

Add a basic where clause to the query.

Parameters
string $modelName
$column
string $operator
$value
string $boolean
public orWhere(string $modelName, $column, string $operator = null, $value = null):Contracts

Add an "or where" clause to the query.

Parameters
string $modelName
$column
string $operator
$value
public whereNull(string $modelName, $column, string $boolean = "and", bool $not = false):Contracts

Add a "where null" clause to the query.

Parameters
string $modelName
$column
string $boolean
bool $not
public orWhereNull(string $modelName, $column):Contracts

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

Parameters
string $modelName
$column

Migrate

Migrate models

Namespace

Plenty\Modules\Plugin\DataBase\Contracts

Methods

public createTable(string $modelClassName, int $readCapacityUnits = 10, int $writeCapacityUnits = 20):bool
Parameters
string $modelClassName
int $readCapacityUnits This field is deprecated and will be removed soon
int $writeCapacityUnits This field is deprecated and will be removed soon
public updateTable(string $modelClassName):bool
Parameters
string $modelClassName
public deleteTable(string $modelClassName):bool
Parameters
string $modelClassName

Model

Database model

Namespace

Plenty\Modules\Plugin\DataBase\Contracts

Properties

Type Name Description
primaryKeyFieldName
primaryKeyFieldType
autoIncrementPrimaryKey
textFields

Methods

public getTableName():string

Query

database query

Namespace

Plenty\Modules\Plugin\DataBase\Contracts

Methods

public where(string $fieldName, string $operator = null, $value = null):Contracts

Add a basic where clause to the query.

Parameters
string $fieldName
string $operator
$value
public whereIn(string $fieldName, array $values, string $boolean = "and", bool $not = false):Contracts

Add a "where in" clause to the query.

Parameters
string $fieldName
array $values
string $boolean
bool $not
public orWhereIn(string $fieldName, array $values):Contracts

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

Parameters
string $fieldName
array $values
public orWhere(string $fieldName, string $operator = null, $value = null):Contracts

Add an "or where" clause to the query.

Parameters
string $fieldName
string $operator
$value
public whereNull(string $fieldName, string $boolean = "and", bool $not = false):Contracts

Add a "where null" clause to the query.

Parameters
string $fieldName
string $boolean
bool $not
public orWhereNull(string $fieldName):void

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

Parameters
string $fieldName
public having(string $fieldName, string $operator = null, string $value = null, string $boolean = "and"):Contracts

Add a "having" clause to the query.

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

Add a "or having" clause to the query.

Parameters
string $fieldName
string $operator
string $value
public orderBy(string $fieldName, string $direction = "asc"):Contracts

Add an "order by" clause to the query.

Parameters
string $fieldName
string $direction
public forPage(int $page, int $perPage = 15):void

Set the limit and offset for a given page.

Parameters
int $page
int $perPage
public count(string $columns = "*"):int

Retrieve the "count" result of the query.

Parameters
string $columns
public limit(int $value):Contracts

Set the "limit" value of the query.

Parameters
int $value
public offset(int $value):Contracts

Set the "offset" value of the query.

Parameters
int $value
public getCountForPagination(array $columns = []):int

Get the count of the total records for the paginator.

Parameters
array $columns
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(string $pluginName, string $tableName, array $attributeDefinitions, array $keySchema, int $readCapacityUnits = 3, int $writeCapacityUnits = 2):bool

Deprecated! (since 2017-06-30)

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

Create a table

Parameters
string $pluginName name of your plugin
string $tableName
array $attributeDefinitions http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html
array $keySchema
int $readCapacityUnits
int $writeCapacityUnits
public updateTable(string $pluginName, string $tableName, int $readCapacityUnits = 3, int $writeCapacityUnits = 2):bool

Deprecated! (since 2017-06-30)

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

Update a table

Parameters
string $pluginName name of your plugin
string $tableName
int $readCapacityUnits
int $writeCapacityUnits
public putItem(string $pluginName, string $tableName, array $item):bool

Deprecated! (since 2017-06-30)

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

Add item to table

Parameters
string $pluginName name of your plugin
string $tableName
array $item
public getItem(string $pluginName, string $tableName, bool $consistentRead, array $key):array

Deprecated! (since 2017-06-30)

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

Retrieving items

Parameters
string $pluginName name of your plugin
string $tableName
bool $consistentRead
array $key
public deleteItem(string $pluginName, string $tableName, array $key):bool

Deprecated! (since 2017-06-30)

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

Delete an item

Parameters
string $pluginName name of your plugin
string $tableName
array $key
public deleteTable(string $pluginName, string $tableName):bool

Deprecated! (since 2017-06-30)

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

Deleting a table

Parameters
string $pluginName name of your plugin
string $tableName
public scan(string $pluginName, string $tableName, string $returnFields = "", array $expressionAttributeValues = [], string $filterExpression = "", int $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
string $pluginName name of your plugin
string $tableName
string $returnFields
array $expressionAttributeValues
string $filterExpression
int $limit is taken into account when value greater than 0

Libs

Contracts

LibraryCallContract

library call

Namespace

Plenty\Modules\Plugin\Libs\Contracts

Methods

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

PluginSet

Models

PluginSet

Eloquent model representing a PluginSet.

Namespace

Plenty\Modules\Plugin\PluginSet\Models

Properties

Type Name Description
int id
int parentPluginSetId
PluginSet parentPluginSet
string name
pluginSetEntries
layoutContainers
webstores

Methods

public toArray()

Returns this model as an array.

PluginSetEntry

Eloquent model representing a Plugin.

Namespace

Plenty\Modules\Plugin\PluginSet\Models

Properties

Type Name Description
int id
int pluginId
int pluginSetId
Plugin plugin

Methods

public toArray()

Returns this model as an array.

Storage

Contracts

StorageRepositoryContract

Storage Repository

Namespace

Plenty\Modules\Plugin\Storage\Contracts

Methods

public uploadObject(string $pluginName, string $key, string $body, bool $publicVisible = false, array $metaData = []):StorageObject

Create an object with content in $body

Parameters
string $pluginName name of your plugin
string $key e.g. myDir/x/y/z/HelloWorld.txt
string $body file content
bool $publicVisible
array $metaData
public getObject(string $pluginName, string $key, bool $publicVisible = false):StorageObject

Get an object

Parameters
string $pluginName name of your plugin
string $key e.g. myDir/x/y/z/HelloWorld.txt
bool $publicVisible
public getObjectUrl(string $pluginName, string $key, bool $publicVisible = false, int $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
string $pluginName name of your plugin
string $key e.g. myDir/x/y/z/HelloWorld.txt
bool $publicVisible
int $minutesToExpire Minutes between 1 and 15
public getObjectAsTemporaryFileResource(string $pluginName, string $key, bool $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
string $pluginName name of your plugin
string $key e.g. myDir/x/y/z/HelloWorld.txt
bool $publicVisible
public doesObjectExist(string $pluginName, string $key, bool $publicVisible = false):bool

Checks if object exists

Parameters
string $pluginName name of your plugin
string $key e.g. myDir/x/y/z/HelloWorld.txt
bool $publicVisible
public deleteObject(string $pluginName, string $key, bool $publicVisible = false):bool

Executes the DeleteObject operation.

Parameters
string $pluginName name of your plugin
string $key myDir/HelloWorld.txt
bool $publicVisible
public listObjects(string $pluginName, string $prefix = "", int $limit, string $startKey = "", string $continuationToken = "", bool $publicVisible = false, bool $resultKeyWithoutPrefix = true):StorageObjectList

Returns some or all (up to 1000) objects

Parameters
string $pluginName name of your plugin
string $prefix Limits the response to keys that begin with the specified prefix.
int $limit The total number of items to return.
string $startKey is where you want to start listing from. $startKey can be any key in the bucket.
string $continuationToken indicates that the list is being continued on this bucket with a token.
bool $publicVisible
bool $resultKeyWithoutPrefix

VersionControl

Models

Git

Model holding plugin data concerning Git version control.

Namespace

Plenty\Modules\Plugin\VersionControl\Models

Properties

Type Name Description
int id git id
int pluginId plugin id
string username username for remote account
string password password for remote account
string remoteUrl url for remote repository
string branch actual selected branch
bool autoFetch automatically fetch from remote repository
string webhookToken token needed for development
string createdAt created timestamp
string updatedAt last update timestamp
Plugin plugin

Methods

public toArray()

Returns this model as an array.