Skip to content
View as Markdown

Company Note Model

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

Global Scope

This model has a global scope that filters by status = '_company_note_'. The status is auto-set on create.

Shared Table

This model shares the fc_subscriber_notes table with SubscriberNote and SystemLog. The subscriber_id column stores the company ID (not a subscriber ID) in this context.

Attributes

AttributeData TypeComment
idInteger
subscriber_idIntegerStores the company ID
parent_idInteger
created_byIntegerAuto-set to current user on create
statusStringAlways '_company_note_'
typeString
titleString
descriptionText
created_atDate TimeAuto-set on create
updated_atDate TimeAuto-set on create and update

Fillable Attributes

php
'subscriber_id',  // company ID
'parent_id',
'created_by',
'type',
'title',
'description',
'created_at'

Relations

company

Access the associated company

  • return FluentCrm\App\Models\Company Model (BelongsTo via subscriber_id)

Example:

php
$company = $note->company;

Methods

markAs($status)

Update the note status

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

Usage

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

createdBy()

Get note creator personal information

  • Parameters
    • none
  • Returns array['ID', 'first_name', 'last_name', 'display_name']

Usage

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