# Subscriber Note Model
DB Table Name | {wp_db_prefix}_fc_subscriber_notes |
---|---|
Schema | Check Schema |
Source File | fluent-crm/app/Models/SubscriberNote.php |
Name Space | FluentCrm\App\Models |
Class | FluentCrm\App\Models\SubscriberNote |
# Attributes
Attribute | Data Type | Comment |
---|---|---|
id | Integer | |
subscriber_id | Integer | |
parent_id | Integer | |
created_by | Integer | |
status | String | |
type | String | |
is_private | Boolean | |
title | String | |
description | Text | |
created_at | Date Time | |
updated_at | Date Time |
# Usage
Please check Model Basic for Common methods.
# Accessing Attributes
$note = FluentCrm\App\Models\SubscriberNote::find(1);
$note->id; // returns id
$note->title; // returns meta title
.......
1
2
3
4
5
6
2
3
4
5
6
# Fillable Attributes
'subscriber_id',
'parent_id',
'created_by',
'status',
'type',
'is_private',
'title',
'description'
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
# Relations
This model has the following relationships that you can use
# subscriber
Access all the associated subscriber of a model
- return
FluentCrm\App\Models\Subscriber
Model Collections
# Example:
// Accessing Subscriber
$subscriber = $note->subscriber;
// For Filtering by subscriber relationship
// 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();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Methods
Along with Global Model methods, this model has few helper methods.
# markAs($status)
Get total number of subscribers of a tag
- Parameters
- $status
string
- $status
- Returns
FluentCrm\App\Models\SubscriberNote
# Usage
$note = $note->markAs('open');
1
# createdBy()
Get note creator personal information
- Parameters
- none
- Returns
array
# Usage
$creatorInfo = $note->createdBy();
1