Skip to content

TaskMeta Model ​

DB Table Name{wp_db_prefix}fbs_task_metas
SchemaCheck Schema
Source Filefluent-boards/app/Models/TaskMeta.php
Name SpaceFluentBoards\App\Models
ClassFluentBoards\App\Models\TaskMeta

Key/value meta for tasks. In most cases use Task::getMeta() and Task::updateMeta() instead of this model.

Keys used by the plugin include:

KeyMeaning
is_pinnedTask is pinned (read by Task::$is_pinned)
group_nameName of a subtask group on the parent task
subtask_group_idOn a subtask: the ID of its subtask group meta row
upvoteRoadmap upvotes

Attributes ​

AttributeData TypeComment
idINT UNSIGNEDPrimary key
task_idINT UNSIGNEDTask ID
keyVARCHAR(100)Meta key
valueLONGTEXT NULLSerialized on write, unserialized on read
created_atTIMESTAMP NULL
updated_atTIMESTAMP NULL

Usage ​

Please check Model Basic for common methods.

php
use FluentBoards\App\Models\TaskMeta;

TaskMeta::create([
    'task_id' => 42,
    'key'     => 'my_plugin_data',
    'value'   => ['foo' => 'bar'], // stored serialized
]);

$value = TaskMeta::where('task_id', 42)->where('key', 'my_plugin_data')->value('value');

TIP

value() on the query builder returns the raw column, so serialized data comes back as a string. Load the model (->first()->value) to get it unserialized.

Relations ​

task ​

  • Returns FluentBoards\App\Models\Task

subtasks ​

For a subtask group row (key = 'group_name'): the subtasks that belong to the group, found through subtask_group_id meta rows whose value is this row's ID.

  • Returns a collection of FluentBoards\App\Models\Task
php
foreach ($task->subtaskGroup as $group) {
    $groupName = $group->value;
    $subtasks  = $group->subtasks;
}