Plentymarkets interface documentation

Comment

Contracts

CommentRepositoryContract

Get, create, update and delete comments.

Namespace

Plenty\Modules\Comment\Contracts

Methods
public getComment($commentId):Plenty\Modules\Comment\Models\Comment
Return type: Comment

Get a comment

Parameters

Name

Type

Description

$commentId

int

The ID of the comment

public listComments($with = []):Illuminate\Support\Collection
Return type: Collection

List comments

Parameters

Name

Type

Description

$with

public createComment($data, $suppressEvent = false):Plenty\Modules\Comment\Models\Comment
Return type: Comment

Create a comment

Parameters

Name

Type

Description

$data

array

The request data

$suppressEvent

bool

Whether to suppress the created event or not.

public deleteComment($commentId):void

Delete a comment

Parameters

Name

Type

Description

$commentId

int

The ID of the comment

public updateComment($data, $commentId):Plenty\Modules\Comment\Models\Comment
Return type: Comment

Update a comment

Parameters

Name

Type

Description

$data

array

$commentId

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

Comment

The comment model can be one of the following types: category, contact, order, item_variation, order_item, specified by the referenceType.

Namespace

Plenty\Modules\Comment\Models

Properties
Name Type Description

id

int

The ID of the comment

referenceType

string

The reference type. Valid types are: <ul> <li>category</li> <li>contact</li> <li>order</li> <li>item_variation</li> <li>order_item</li> </ul>

referenceValue

int

The reference value

userId

int

The ID of the user

createdAt

The date when the comment was created

text

string

The comment text

isVisibleForContact

bool

If true, the comment is visible for the associated contact.

Methods
public toArray()

Returns this model as an array.