Plentymarkets interface documentation

Blog

Contracts

BlogPostRepositoryContract

This interface provides methods to create, read, list, update and delete blog posts

Namespace

Plenty\Modules\Blog\Contracts

Methods
public createPost($data):Plenty\Modules\Blog\Models\BlogPost
Return type: BlogPost

Creates a new blog post.

Parameters

Name

Type

Description

$data

array

Blog post data

public getPost($blogPostId):Plenty\Modules\Blog\Models\BlogPost
Return type: BlogPost

Get a single blog post by its ID

Parameters

Name

Type

Description

$blogPostId

string

public listPosts($page = 1, $itemsPerPage = 50, $filters = []):array

Lists all blog posts for current plenty ID.

Parameters

Name

Type

Description

$page

int

$itemsPerPage

int

$filters

array

public updatePost($data, $blogPostId):Plenty\Modules\Blog\Models\BlogPost
Return type: BlogPost

Update data for a post

Parameters

Name

Type

Description

$data

array

$blogPostId

string

public deletePost($blogPostId):void

Delete a single blog post by its ID

Parameters

Name

Type

Description

$blogPostId

string

public migratePosts($data = []):void

Migrate old posts to new

Parameters

Name

Type

Description

$data

array

public getOldPostById($id):void

Get old blog post by its ID

Parameters

Name

Type

Description

$id

int

public clearCriteria():void

Resets all Criteria filters by creating a new instance of the builder object.

public applyCriteriaFromFilters():void

Applies criteria classes to the current repository.

public setFilters($filters = []):void

Sets the filter array.

Parameters

Name

Type

Description

$filters

array

public getFilters():void

Returns the filter array.

public getConditions():void

Returns a collection of parsed filters as Condition object

public clearFilters():void

Clears the filter array.

Models

BlogPost

The blog post model.

Namespace

Plenty\Modules\Blog\Models

Properties
Name Type Description

id

string

plentyIdHash

string

data

string

Methods
public toArray()

Returns this model as an array.

Services

BlogPluginService

The blog plugin service

Namespace

Plenty\Modules\Blog\Services

Methods
public getPluginSetIdFromConfig():void

Get the ID of the plugin set.

public findCategoryByUrl($level1, $level2 = null, $level3 = null, $level4 = null, $level5 = null, $level6 = null, $webstoreId = null, $lang = null):void

Get the category by URL.

Parameters

Name

Type

Description

$level1

string

$level2

string

$level3

string

$level4

string

$level5

string

$level6

string

$webstoreId

int

$lang

string