Blog

Contracts

BlogPostRepositoryContract

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

Namespace

Plenty\Modules\Blog\Contracts

Methods

public createPost(array $data):BlogPost

Creates a new blog post.

Parameters
array $data Blog post data
public getPost(string $blogPostId):BlogPost

Get a single blog post by its ID

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

Lists all blog posts for current plenty ID.

Parameters
int $page
int $itemsPerPage
array $filters
public updatePost(array $data, string $blogPostId):BlogPost

Update data for a post

Parameters
array $data
string $blogPostId
public deletePost(string $blogPostId):void

Delete a single blog post by its ID

Parameters
string $blogPostId
public migratePosts(array $data = []):void

Migrate old posts to new

Parameters
array $data
public getOldPostById(int $id):void

Get old blog post by its ID

Parameters
int $id
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(array $filters = []):void

Sets the filter array.

Parameters
array $filters
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

Type Name Description
string id
string plentyIdHash
string data

Methods

public toArray()

Returns this model as an array.

Services

BlogPluginService

Blog plugin service

Namespace

Plenty\Modules\Blog\Services

Methods

public getPluginSetIdFromConfig():void

Get plugin set ID

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