Board

Contracts

BoardColumnRepositoryContract

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 assign it to a specific board.

Parameters
string $boardId The ID of the board to assign the new column to.
array $data 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 where the column belongs to
string $columnId The ID of the column to update
array $data The data to assign to the specified column
public copy(string $boardId, string $columnId):BoardColumn

Copy a column and all its tasks.

Parameters
string $boardId The ID of the board where 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.

Parameters
string $boardId The ID of the board where 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 where the column belongs to
string $columnId The ID of the column to delete

BoardTaskRepositoryContract

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.

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 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 assign 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 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
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 update
array $data Data to set at the task
public addReference(BoardTaskReference
 $boardTaskReference):bool

Add task reference to task object

Parameters
BoardTaskReference $boardTaskReference
public removeReference(BoardTaskReference
 $boardTaskReference):bool

Remove task reference from task object

Parameters
BoardTaskReference $boardTaskReference
public updatePosition(string $taskId, string $newColumnId, int $newPosition):int

Updates the position of a specified task.

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 delete
public deleteByColumn(string $boardId, string $columnId):bool

Deletes all tasks of a column

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

Get all tasks for the given column id having a reference with the given reference value.

Parameters
string $columnId The column id of the tasks
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

Get all tasks for the given column id having a reference with the given reference value.

Parameters
string $boardId The board id of the tasks
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.

BoardRepositoryContract

This interface provides all methods to access, create, update or delete boards.

Namespace

Plenty\Modules\Board\Contracts

Methods

public list(array $columns = []):Collection

List 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 Maximum number of tasks to load for each column
public create(array $data):Board

Creates a new board.

Parameters
array $data 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 exists
public copy(string $boardId):Board

Copy a board and all its columns.

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

Update 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 delete

BoardTaskReferenceRepositoryContract

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.

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
public checkReferenceKey(string $referenceType, int $referenceKey):bool

Check 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 correspnding reference type

Models

BoardTaskReference

The task reference model.

Namespace

Plenty\Modules\Board\Models

Properties

Type Name Description
string id
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.

Board

the board model.

Namespace

Plenty\Modules\Board\Models

Properties

Type Name Description
string id
string boardName
Collection boardColumns
int columnsCount
int tasksCount

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
string boardId
string columnName
int position
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
string taskName
string description
int position
string columnId
string boardId
tags
references

Methods

public toArray()

Returns this model as an array.

Events

AfterBoardTaskReferenceCreated

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

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

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

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

BeforeBoardDeleted

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

Namespace

Plenty\Modules\Board\Events

Methods

public getBoard():Board

AfterBoardTaskReferenceDeleted

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

Namespace

Plenty\Modules\Board\Events

Methods

public getBoardTaskReference():BoardTaskReference

AfterBoardTaskCreated

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

Namespace

Plenty\Modules\Board\Events

Methods

public getBoardTask():BoardTask

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