Comment

Contracts

CommentRepositoryContract

Get, create, update and delete comments.

Namespace

Plenty\Modules\Comment\Contracts

Methods

public getComment(int $commentId):Comment

Get a comment

Parameters
int $commentId The ID of the comment
public listComments():Collection

List comments

public createComment(array $data):Comment

Create a comment

Parameters
array $data The request data
public deleteComment(int $commentId):void

Delete a comment

Parameters
int $commentId The ID of the comment
public updateComment(array $data, int $commentId):Comment

Update a comment

Parameters
array $data
int $commentId
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

Comment

The comment model.

Namespace

Plenty\Modules\Comment\Models

Properties

Type Name Description
int id The ID of the comment
string referenceType The reference type. Valid types are:
  • category
  • contact
  • order
  • item_variation
int referenceValue The reference value
int userId The ID of the user
createdAt The date when the comment was created
string text The comment text
bool isVisibleForContact If true, the comment is visible for the associated contact.

Methods

public toArray()

Returns this model as an array.