Get, create, update and delete comments.
Plenty\Modules\Comment\Contracts
public getComment(int $commentId):Comment
Get a comment
int | $commentId | The ID of the comment |
public listComments():Collection
List comments
public createComment(array $data, bool $suppressEvent = false):Comment
Create a comment
array | $data | The request data |
bool | $suppressEvent | Whether to suppress the created event or not. |
public deleteComment(int $commentId):void
Delete a comment
int | $commentId | The ID of the comment |
public updateComment(array $data, int $commentId):Comment
Update a comment
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.
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 comment model can be one of the following types: category, contact, order, item_variation, order_item, specified by the referenceType.
Plenty\Modules\Comment\Models
Type | Name | Description |
---|---|---|
int | id | The ID of the comment |
string | referenceType | The reference type. Valid types are:
|
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. |
public toArray()
Returns this model as an array.