Skip to content
View as Markdown

Subscriber Note Model

DB Table Name{wp_db_prefix}_fc_subscriber_notes
SchemaCheck Schema
Source Filefluent-crm/app/Models/SubscriberNote.php
Name SpaceFluentCrm\App\Models
ClassFluentCrm\App\Models\SubscriberNote

Global Scope

This model has a global scope that excludes rows where status IN ('_company_note_', '_system_log_'). This means queries on SubscriberNote only return regular contact notes.

Shared Table

The fc_subscriber_notes table is shared by three models:

  • SubscriberNote — regular contact notes (excludes _company_note_ and _system_log_ statuses)
  • CompanyNote — company notes (status = '_company_note_')
  • SystemLog — system log entries (status = '_system_log_')

Attributes

AttributeData TypeComment
idInteger
subscriber_idInteger
parent_idInteger
created_byIntegerAuto-set to current user on create
statusString
typeString
is_privateBoolean
titleString
descriptionText
created_atDate TimeAuto-set on create
updated_atDate TimeAuto-set on create and update

Usage

Please check Model Basic for Common methods.

Accessing Attributes

php

$note = FluentCrm\App\Models\SubscriberNote::find(1);

$note->id; // returns id
$note->title; // returns title
$note->description; // returns description
.......

Fillable Attributes

php
'subscriber_id',
'parent_id',
'created_by',
'type',
'title',
'description',
'created_at'

Relations

subscriber

Access the associated subscriber of a note

  • return FluentCrm\App\Models\Subscriber Model

Example:

php
// Accessing Subscriber
$subscriber = $note->subscriber;

// Get notes which has subscriber ids: 1/2/3
$notes = FluentCrm\App\Models\SubscriberNote::whereHas('subscriber', function($query) {
    $query->whereIn('id', [1,2,3]);
})->get();

// Get notes which does not have subscriber ids: 1/2/3
$notes = FluentCrm\App\Models\SubscriberNote::whereDoesntHave('subscriber', function($query) {
    $query->whereIn('id', [1,2,3]);
})->get();

Methods

markAs($status)

Update the note status

  • Parameters
    • $status string
  • Returns FluentCrm\App\Models\SubscriberNote

Usage

php
$note = $note->markAs('open');

createdBy()

Get note creator personal information

  • Parameters
    • none
  • Returns array['ID', 'display_name', 'photo']

Usage

php
$creatorInfo = $note->createdBy();