This interface provides methods to create, read, list, update and delete blog posts
Plenty\Modules\Blog\Contracts
public createPost(array $data):BlogPost
Creates a new blog post.
array | $data | Blog post data |
public getPost(string $blogPostId):BlogPost
Get a single blog post by its ID
string | $blogPostId |
public listPosts(int $page = 1, int $itemsPerPage = 50, array $filters = []):array
Lists all blog posts for current plenty ID.
int | $page | |
int | $itemsPerPage | |
array | $filters |
public updatePost(array $data, string $blogPostId):BlogPost
Update data for a post
array | $data | |
string | $blogPostId |
public deletePost(string $blogPostId):void
Delete a single blog post by its ID
string | $blogPostId |
public migratePosts(array $data = []):void
Migrate old posts to new
array | $data |
public getOldPostById(int $id):void
Get old blog post by its ID
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.
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.
The blog post model.
Plenty\Modules\Blog\Models
Type | Name | Description |
---|---|---|
string | id | |
string | plentyIdHash | |
string | data |
public toArray()
Returns this model as an array.
Blog plugin service
Plenty\Modules\Blog\Services
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
string | $level1 | |
string | $level2 | |
string | $level3 | |
string | $level4 | |
string | $level5 | |
string | $level6 | |
int | $webstoreId | |
string | $lang |