# CustomContactField Model

DB Table Name {wp_db_prefix}_fc_meta
Schema Check Schema
Source File fluent-crm/app/Models/CustomContactField.php
Name Space FluentCrm\App\Models
Class FluentCrm\App\Models\CustomContactField

# Attributes

Attribute Data Type Comment
id Integer
object_type String
object_id Integer
key String For Custom Contact Field Model, default key is contact_custom_fields
value Text
created_at Date Time
updated_at Date Time

# Usage

Please check Model Basic for Common methods.

# Accessing Attributes


$customContactField = FluentCrm\App\Models\CustomContactField::find(1);

$customContactField->id; // returns id
$customContactField->value; // returns Contact custom fields
.......
1
2
3
4
5
6

# Fillable Attributes


'object_type',
'object_id',
'key',
'value'
1
2
3
4
5

# Methods

Along with Global Model methods, this model has few helper methods.

# getGlobalFields($with)

Get all global custom fields

  • Parameters
    • $with array optional
  • Returns array

# Usage

$customFields = $customContactField->getGlobalFields();
1

# getFieldTypes()

Get custom field types

  • Parameters
    • none
  • Returns array

# Usage

$fieldTypes = $customContactField->getFieldTypes();
1

# saveGlobalFields($fields)

Save global custom fields

  • Parameters
    • $fields array
  • Returns array

# Usage

$formattedFields = $customContactField->saveGlobalFields($fields);
1

# formatCustomFieldValues($values, $fields = [])

Format custom field values and return formatted values

  • Parameters
    • $values array
    • $fields array optional
  • Returns array

# Usage

$formattedData = $customContactField->formatCustomFieldValues($values);
1