Plentymarkets interface documentation

Board

Contracts

BoardColumnRepositoryContract

The BoardColumnRepositoryContract is the interface for the board column repository. This interface provides methods to access, create, update or delete columns.

Namespace

Plenty\Modules\Board\Contracts

Methods
public list($boardId):Illuminate\Support\Collection
Return type: Collection

Lists all columns assigned to a specific board.

Parameters

Name

Type

Description

$boardId

string

The ID of the board to get columns for

public create($boardId, $data):Plenty\Modules\Board\Models\BoardColumn
Return type: BoardColumn

Creates a new column and assigns it to a specific board.

Parameters

Name

Type

Description

$boardId

string

The ID of the board to assign the new column to

$data

array

The data of the new column

public update($boardId, $columnId, $data):Plenty\Modules\Board\Models\BoardColumn
Return type: BoardColumn

Updates a specific column.

Parameters

Name

Type

Description

$boardId

string

The ID of the board the column belongs to

$columnId

string

The ID of the column to be updated

$data

array

The data to assign to the specified column

public copy($boardId, $columnId):Plenty\Modules\Board\Models\BoardColumn
Return type: BoardColumn

Copies a column and all its tasks.

Parameters

Name

Type

Description

$boardId

string

The ID of the board the column belongs to

$columnId

string

The ID of the column to be copied

public updatePosition($boardId, $columnId, $newPosition):bool

Updates the position of a specified column. This will update the position of all affected columns on the same board too.

Parameters

Name

Type

Description

$boardId

string

The ID of the board the column belongs to

$columnId

string

The ID of the column to update the position for

$newPosition

int

The new position

public delete($boardId, $columnId):bool

Deletes a specific column.

Parameters

Name

Type

Description

$boardId

string

The ID of the board the column belongs to

$columnId

string

The ID of the column to be deleted

BoardRepositoryContract

The BoardRepositoryContract is the interface for the board repository. This interface provides all methods to access, create, update or delete boards.

Namespace

Plenty\Modules\Board\Contracts

Methods
public list($columns = []):Illuminate\Database\Eloquent\Collection
Return type: Collection

Lists all boards.

Parameters

Name

Type

Description

$columns

array

Fields to load for each board

public get($boardId, $tasksPerPage = 20):Plenty\Modules\Board\Models\Board
Return type: Board

Returns a single board.

Parameters

Name

Type

Description

$boardId

string

The ID of the board to get

$tasksPerPage

int

The maximum number of tasks to load for each column

public create($data):Plenty\Modules\Board\Models\Board
Return type: Board

Creates a new board.

Parameters

Name

Type

Description

$data

array

The data of the new board

public update($boardId, $data):Plenty\Modules\Board\Models\Board
Return type: Board

Updates a board.

Parameters

Name

Type

Description

$boardId

string

The ID of the board to be updated

$data

array

New data to be assigned to the board if it exists

public copy($boardId):Plenty\Modules\Board\Models\Board
Return type: Board

Copies a board and all its columns.

Parameters

Name

Type

Description

$boardId

string

The ID of the board to be copied

public updateTasksCount($boardId):bool

Updates the tasks count value.

Parameters

Name

Type

Description

$boardId

string

The ID of the board to update the tasks count

public delete($boardId):bool

Deletes a board. Returns true if the deletion was successful.

Parameters

Name

Type

Description

$boardId

string

The ID of the board to be deleted

BoardTaskReferenceRepositoryContract

The BoardTaskReferenceRepositoryContract is the interface for the board task reference repository. This interface provides methods to create or delete references from tasks to contacts or tickets.

Namespace

Plenty\Modules\Board\Contracts

Methods
public create($taskId, $referenceValue):Plenty\Modules\Board\Models\BoardTaskReference
Return type: BoardTaskReference

Creates a new reference to a given task. A reference may either point to a contact or to a ticket.

Parameters

Name

Type

Description

$taskId

string

The ID of the task to create a reference for

$referenceValue

string

Reference type followed by foreign ID of the referenced object. Syntax: TYPE-ID Example: user-123456 Types: user,ticket,contact,order,item

public delete($referenceId):bool

Deletes a specific reference.

Parameters

Name

Type

Description

$referenceId

string

The ID of the reference

public checkReferenceKey($referenceType, $referenceKey):bool

Checks whether the reference key for the given reference type exists or not.

Parameters

Name

Type

Description

$referenceType

string

The reference type (one of 'contact', 'order', 'item', 'ticket' or 'user')

$referenceKey

int

The ID of the corresponding reference type

BoardTaskRepositoryContract

The BoardTaskRepositoryContract is the interface for the board task repository. This interface provides methods to access, create, update or delete tasks.

Namespace

Plenty\Modules\Board\Contracts

Methods
public list($columnId, $startAt, $tasksPerPage = 20, $columns = []):Illuminate\Database\Eloquent\Collection
Return type: Collection

Lists tasks for a specific column. Will return at most 20 tasks starting at defined task.

Parameters

Name

Type

Description

$columnId

string

The ID of the column to get tasks for

$startAt

int

The position of a task to start listing at

$tasksPerPage

int

The number of tasks to get per page

$columns

array

Fields to load for each task

public create($boardId, $columnId, $data):Plenty\Modules\Board\Models\BoardTask
Return type: BoardTask

Creates a new task and assigns it to a specified column.

Parameters

Name

Type

Description

$boardId

string

The ID of the board the column belongs to

$columnId

string

The ID of the column to assign the created task to

$data

array

The data of the new task

public copy($boardId, $columnId, $taskId):Plenty\Modules\Board\Models\BoardTask
Return type: BoardTask

Copies the task with all references.

Parameters

Name

Type

Description

$boardId

string

The ID of the board the column belongs to

$columnId

string

The ID of the column to assign the copied task to

$taskId

string

The ID of the task to be copied

public get($taskId):Plenty\Modules\Board\Models\BoardTask
Return type: BoardTask

Returns a task for a given ID.

Parameters

Name

Type

Description

$taskId

string

The ID of the task

public update($boardId, $columnId, $taskId, $data):Plenty\Modules\Board\Models\BoardTask
Return type: BoardTask

Updates a specified task.

Parameters

Name

Type

Description

$boardId

string

The ID of the board the column belongs to

$columnId

string

The ID of the column the task belongs to

$taskId

string

The ID of the task to be updated

$data

array

Data to set at the task

public addReference($boardTaskReference):bool

Adds a task reference to a task object.

Parameters

Name

Type

Description

$boardTaskReference

BoardTaskReference

The board task reference

public removeReference($boardTaskReference):bool

Removes a task reference from a task object.

Parameters

Name

Type

Description

$boardTaskReference

BoardTaskReference

The board task reference

public updatePosition($taskId, $newColumnId, $newPosition):int

Updates the position of a specified task. Will also update the position of all following tasks in the same column.

Parameters

Name

Type

Description

$taskId

string

The ID of the task to update the position for

$newColumnId

string

The ID of the column the task now belongs to

$newPosition

int

The new position

public delete($taskId):bool

Deletes a specified task.

Parameters

Name

Type

Description

$taskId

string

The ID of the task to be deleted

public deleteByColumn($boardId, $columnId):bool

Deletes all tasks of a column.

Parameters

Name

Type

Description

$boardId

string

The ID of the board the column belongs to

$columnId

string

The ID of the column the task belongs to

public allByColumnId($columnId, $referenceValue = null, $columns = []):void

Gets all tasks for the given column ID having a reference with the given reference value.

Parameters

Name

Type

Description

$columnId

string

The ID of the column

$referenceValue

string

The reference value that has to be contained in the task. Can be NULL.

$columns

array

The attributes of the task to load

public allByBoardId($boardId, $referenceValue = null, $columns = []):void

Gets all tasks for the given column ID having a reference with the given reference value.

Parameters

Name

Type

Description

$boardId

string

The ID of the board

$referenceValue

string

The reference value that has to be contained in the task. Can be NULL.

$columns

array

The attributes of the task to load

Events

AfterBoardColumnTasksDeleted

This event will be triggered, after all tasks of a column were deleted.

Namespace

Plenty\Modules\Board\Events

Methods
public getBoardId():string
public getColumnId():string
public getDeletedTaskIdList():array

AfterBoardTaskCreated

This event will be triggered, when a board task was created.

Namespace

Plenty\Modules\Board\Events

Methods
public getBoardTask():Plenty\Modules\Board\Models\BoardTask
Return type: BoardTask

AfterBoardTaskDeleted

This event will be triggered, when a single board task was deleted. It won't be triggered, if a board column was deleted.

Namespace

Plenty\Modules\Board\Events

Methods
public getBoardTask():Plenty\Modules\Board\Models\BoardTask
Return type: BoardTask

AfterBoardTaskReferenceCreated

This event will be triggered, after a task reference was created.

Namespace

Plenty\Modules\Board\Events

Methods
public getBoardTaskReference():Plenty\Modules\Board\Models\BoardTaskReference
Return type: BoardTaskReference

AfterBoardTaskReferenceDeleted

This event will be triggered, after a task reference was deleted.

Namespace

Plenty\Modules\Board\Events

Methods
public getBoardTaskReference():Plenty\Modules\Board\Models\BoardTaskReference
Return type: BoardTaskReference

BeforeBoardColumnDeleted

This event will be triggered, before a board column will be deleted.

Namespace

Plenty\Modules\Board\Events

Methods
public getBoard():Plenty\Modules\Board\Models\Board
Return type: Board
public getColumnId():string

BeforeBoardDeleted

This event will be triggered, before a board will be deleted.

Namespace

Plenty\Modules\Board\Events

Methods
public getBoard():Plenty\Modules\Board\Models\Board
Return type: Board

BeforeBoardTaskDeleted

This event will be triggered, before a single board task was deleted. It won't be triggered, if a board column will be deleted.

Namespace

Plenty\Modules\Board\Events

Methods
public getBoardTask():Plenty\Modules\Board\Models\BoardTask
Return type: BoardTask

Models

Board

The board model.

Namespace

Plenty\Modules\Board\Models

Properties
Name Type Description

id

string

The ID of the board

boardName

string

The name of the board

boardColumns

Collection

The columns of the board

columnsCount

int

The number of columns

tasksCount

int

The number of tasks

Methods
public toArray()

Returns this model as an array.

BoardColumn

The board column model.

Namespace

Plenty\Modules\Board\Models

Properties
Name Type Description

id

string

The ID of the board column

boardId

string

The ID of the board

columnName

string

The name of the column

position

int

The position

tasks

The tasks

Methods
public toArray()

Returns this model as an array.

BoardTask

The board task model.

Namespace

Plenty\Modules\Board\Models

Properties
Name Type Description

id

string

The ID of the board task

taskName

string

The name of the task

description

string

The description of the task

position

int

The position of the task

columnId

string

The ID of the column

boardId

string

The ID of the board

tags

references

Methods
public toArray()

Returns this model as an array.

BoardTaskReference

The task reference model.

Namespace

Plenty\Modules\Board\Models

Properties
Name Type Description

id

string

The ID of the board task reference

taskId

string

The ID of the task to create a reference for

referenceValue

string

Reference type followed by foreign ID of the referenced object. Syntax: TYPE-ID Example: user-123456 Types: user,ticket,contact,order,item

Methods
public toArray()

Returns this model as an array.