# Stage Model
DB Table Name | {wp_db_prefix}_fbs_board_terms |
---|---|
Schema | Check Schema |
Source File | fluent-boards/app/Models/Stage.php |
Name Space | FluentBoards\App\Models |
Class | FluentBoards\App\Models\Stage |
# Attributes
Attribute | Data Type | Comment |
---|---|---|
id | INT UNSIGNED Auto Increment | Primary key of the term |
board_id | INT UNSIGNED | ID of the board associated with the term |
title | VARCHAR(100) NULL | Title of the stage or label. In case of a label, the title can be null with only a color. |
slug | VARCHAR(100) NULL | Slug of the stage or label |
type | VARCHAR(50) NOT NULL DEFAULT 'stage' | Type of the term: 'stage' or 'label' |
position | DECIMAL(10,2) NOT NULL DEFAULT '1' | Position of the stage or label. 1 = first, 2 = second, etc. |
color | VARCHAR(50) NULL | Text color of the stage or label |
bg_color | VARCHAR(50) NULL | Background color of the stage or label |
settings | TEXT NULL | Serialized settings for the term |
archived_at | TIMESTAMP NULL | Timestamp when the term was archived |
created_at | TIMESTAMP NULL | Timestamp when the term was created |
updated_at | TIMESTAMP NULL | Timestamp when the term was last updated |
# Usage
Please check Model Basic for Common methods.
# Accessing Attributes
$stage = FluentBoards\App\Models\Stage::find(1);
$stage->id; // returns id
$stage->title; // returns title
.......
1
2
3
4
5
6
2
3
4
5
6
# Methods
Along with Global Model methods, this model has few helper methods.
# moveToNewPosition($newIndex)
Move the stage to a new position within the board. This method repositions the stage to the specified index within the board. If the new position is already taken, it reindexes the positions of all stages and retries the move operation.
- Parameters
- $newIndex
numeric
- $newIndex
- Returns
array
updated stage
# Usage
$stage->moveToNewPosition($position);
1