Skip to content

NotificationPreference Model

Holds a member's explicit notification overrides in fcom_notification_prefs, one row per event and channel. A missing row means the site default applies.

Table

  • Table: fcom_notification_prefs

  • Primary key: id

  • Extends: Model

Attributes

ColumnTypeNullableDefaultDescription
idBIGINT UNSIGNEDNoPrimary key for the row.
user_idBIGINT UNSIGNEDNoWordPress user ID associated with the row.
channelVARCHAR(20)No'mail'Channel stored for this record.
event_keyVARCHAR(50)NoEvent Key stored for this record.
object_idBIGINT UNSIGNEDNo0Associated object ID, interpreted together with the object type.
valueTINYINT UNSIGNEDNo0Serialized meta value.
created_atTIMESTAMPYesCreation timestamp maintained by the ORM.
updated_atTIMESTAMPYesUpdate timestamp maintained by the ORM.

Relationships

MethodTypeTargetNotes
user()belongsToUserSignature:
xprofile()belongsToXProfileSignature:

Scopes

ScopeParametersPurpose
ForChannel$query, $channelFor Channel scope declared on the model.
ForEvent$query, $eventKeyFor Event scope declared on the model.
GlobalScoped$queryGlobal Scoped scope declared on the model.
Enabled$queryEnabled scope declared on the model.

Key Methods

MethodDescription
No additional public methods are documented for this model.

Usage Examples

php
use FluentCommunity\App\Models\NotificationPreference;

$records = NotificationPreference::query()
    ->forChannel(null)
    ->limit(10)
    ->get();

$first = NotificationPreference::query()->first();

FluentCommunity developer documentation