Skip to content

Meta Model ​

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

Generic key/value storage. object_type says what the row belongs to. The model has no global scope; always filter by object_type.

object_typeobject_idUsed for
option—Plugin options (fluent_boards_get_option() / fluent_boards_update_option())
boardBoard IDBoard meta (Board::getMeta() / Board::updateMeta())
userUser IDPer-user settings
webhook—Incoming webhooks (Webhook model)
outgoing_webhook—Outgoing webhooks
repeat_taskTask IDRepeat task settings (Task::repeatTaskMeta())
fluent_board_adminUser IDFluentBoards admin flag

The Webhook model extends this model.

Attributes ​

AttributeData TypeComment
idINT UNSIGNEDPrimary key
object_idINT UNSIGNED NULLRelated object ID
object_typeVARCHAR(100)See the table above
keyVARCHAR(100) NULLMeta key
valueLONGTEXT NULLSerialized on write, unserialized on read
created_atTIMESTAMP NULL
updated_atTIMESTAMP NULL

Usage ​

Please check Model Basic for common methods.

For plugin options, use the helpers instead of the model:

php
fluent_boards_update_option('my_option', ['enabled' => 'yes']);
$value = fluent_boards_get_option('my_option', []);

For your own data, use a unique object_type so you do not collide with FluentBoards rows:

php
use FluentBoards\App\Models\Meta;

Meta::create([
    'object_id'   => $board->id,
    'object_type' => 'my_plugin_board_data',
    'key'         => 'sync_status',
    'value'       => ['last_sync' => current_time('mysql')],
]);

$meta = Meta::where('object_type', 'my_plugin_board_data')
    ->where('object_id', $board->id)
    ->where('key', 'sync_status')
    ->first();

$data = $meta ? $meta->value : null; // array