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(string $boardId):Collection

Lists all columns assigned to a specific board.

Parameters
string $boardId The ID of the board to get columns for
public create(string $boardId, array $data):BoardColumn

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

Parameters
string $boardId The ID of the board to assign the new column to
array $data The data of the new column
public update(string $boardId, string $columnId, array $data):BoardColumn

Updates a specific column.

Parameters
string $boardId The ID of the board the column belongs to
string $columnId The ID of the column to be updated
array $data The data to assign to the specified column
public copy(string $boardId, string $columnId):BoardColumn

Copies a column and all its tasks.

Parameters
string $boardId The ID of the board the column belongs to
string $columnId The ID of the column to be copied
public updatePosition(string $boardId, string $columnId, int $newPosition):bool

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

Parameters
string $boardId The ID of the board the column belongs to
string $columnId The ID of the column to update the position for
int $newPosition The new position
public delete(string $boardId, string $columnId):bool

Deletes a specific column.

Parameters
string $boardId The ID of the board the column belongs to
string $columnId 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(array $columns = []):Collection

Lists all boards.

Parameters
array $columns Fields to load for each board
public get(string $boardId, int $tasksPerPage = 20):Board

Returns a single board.

Parameters
string $boardId The ID of the board to get
int $tasksPerPage The maximum number of tasks to load for each column
public create(array $data):Board

Creates a new board.

Parameters
array $data The data of the new board
public update(string $boardId, array $data):Board

Updates a board.

Parameters
string $boardId The ID of the board to be updated
array $data New data to be assigned to the board if it exists
public copy(string $boardId):Board

Copies a board and all its columns.

Parameters
string $boardId The ID of the board to be copied
public updateTasksCount(string $boardId):bool

Updates the tasks count value.

Parameters
string $boardId The ID of the board to update the tasks count
public delete(string $boardId):bool

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

Parameters
string $boardId 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(string $taskId, string $referenceValue):BoardTaskReference

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

Parameters
string $taskId The ID of the task to create a reference for
string $referenceValue Reference type followed by foreign ID of the referenced object. Syntax: TYPE-ID Example: user-123456 Types: user,ticket,contact,order,item
public delete(string $referenceId):bool

Deletes a specific reference.

Parameters
string $referenceId The ID of the reference
public checkReferenceKey(string $referenceType, int $referenceKey):bool

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

Parameters
string $referenceType The reference type (one of 'contact', 'order', 'item', 'ticket' or 'user')
int $referenceKey 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(string $columnId, int $startAt, int $tasksPerPage = 20, array $columns = []):Collection

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

Parameters
string $columnId The ID of the column to get tasks for
int $startAt The position of a task to start listing at
int $tasksPerPage The number of tasks to get per page
array $columns Fields to load for each task
public create(string $boardId, string $columnId, array $data):BoardTask

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

Parameters
string $boardId The ID of the board the column belongs to
string $columnId The ID of the column to assign the created task to
array $data The data of the new task
public copy(string $boardId, string $columnId, string $taskId):BoardTask

Copies the task with all references.

Parameters
string $boardId The ID of the board the column belongs to
string $columnId The ID of the column to assign the copied task to
string $taskId The ID of the task to be copied
public get(string $taskId):BoardTask

Returns a task for a given ID.

Parameters
string $taskId The ID of the task
public update(string $boardId, string $columnId, string $taskId, array $data):BoardTask

Updates a specified task.

Parameters
string $boardId The ID of the board the column belongs to
string $columnId The ID of the column the task belongs to
string $taskId The ID of the task to be updated
array $data Data to set at the task
public addReference(BoardTaskReference
 $boardTaskReference):bool

Adds a task reference to a task object.

Parameters
BoardTaskReference $boardTaskReference The board task reference
public removeReference(BoardTaskReference
 $boardTaskReference):bool

Removes a task reference from a task object.

Parameters
BoardTaskReference $boardTaskReference The board task reference
public updatePosition(string $taskId, string $newColumnId, int $newPosition):int

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

Parameters
string $taskId The ID of the task to update the position for
string $newColumnId The ID of the column the task now belongs to
int $newPosition The new position
public delete(string $taskId):bool

Deletes a specified task.

Parameters
string $taskId The ID of the task to be deleted
public deleteByColumn(string $boardId, string $columnId):bool

Deletes all tasks of a column.

Parameters
string $boardId The ID of the board the column belongs to
string $columnId The ID of the column the task belongs to
public allByColumnId(string $columnId, string $referenceValue = null, array $columns = []):void

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

Parameters
string $columnId The ID of the column
string $referenceValue The reference value that has to be contained in the task. Can be NULL.
array $columns The attributes of the task to load
public allByBoardId(string $boardId, string $referenceValue = null, array $columns = []):void

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

Parameters
string $boardId The ID of the board
string $referenceValue The reference value that has to be contained in the task. Can be NULL.
array $columns 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():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():BoardTask

AfterBoardTaskReferenceCreated

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

Namespace

Plenty\Modules\Board\Events

Methods

public getBoardTaskReference():BoardTaskReference

AfterBoardTaskReferenceDeleted

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

Namespace

Plenty\Modules\Board\Events

Methods

public getBoardTaskReference():BoardTaskReference

BeforeBoardColumnDeleted

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

Namespace

Plenty\Modules\Board\Events

Methods

public getBoard():Board
public getColumnId():string

BeforeBoardDeleted

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

Namespace

Plenty\Modules\Board\Events

Methods

public getBoard():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():BoardTask

Models

Board

The board model.

Namespace

Plenty\Modules\Board\Models

Properties

Type Name Description
string id The ID of the board
string boardName The name of the board
Collection boardColumns The columns of the board
int columnsCount The number of columns
int tasksCount The number of tasks

Methods

public toArray()

Returns this model as an array.

BoardColumn

The board column model.

Namespace

Plenty\Modules\Board\Models

Properties

Type Name Description
string id The ID of the board column
string boardId The ID of the board
string columnName The name of the column
int position 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

Type Name Description
string id The ID of the board task
string taskName The name of the task
string description The description of the task
int position The position of the task
string columnId The ID of the column
string boardId 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

Type Name Description
string id The ID of the board task reference
string taskId The ID of the task to create a reference for
string referenceValue 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.