CfData
extends Model
in package
uses
HasFactory
Custom Field Data Model
This model manages custom field data for the CICMS system. It stores page-specific custom field values and provides methods for retrieving, deleting, and managing custom field data.
Table of Contents
Properties
- $fillable : array<string|int, string>
- The attributes that are mass assignable.
Methods
- __construct() : void
- Create a new CfData model instance.
- deleteCFValue() : int
- Delete custom field data for a specific page and field.
- getCFData() : Collection
- Get custom field data for a specific page and multiple fields.
- getCFValue() : Collection
- Get custom field value for a specific page and field.
Properties
$fillable
The attributes that are mass assignable.
protected
array<string|int, string>
$fillable
= ['page_id', 'pcf_id', 'pcf_value']
Methods
__construct()
Create a new CfData model instance.
public
__construct() : void
Sets the table name from configuration constants.
deleteCFValue()
Delete custom field data for a specific page and field.
public
deleteCFValue(int $page_id, int $pcf_id) : int
Removes all custom field data matching the given page_id and pcf_id.
Parameters
- $page_id : int
-
The page identifier
- $pcf_id : int
-
The custom field identifier
Return values
int —Number of deleted records
getCFData()
Get custom field data for a specific page and multiple fields.
public
getCFData(int $page_id, array<string|int, mixed> $pcf_id) : Collection
Retrieves custom field data for a page with multiple field identifiers.
Parameters
- $page_id : int
-
The page identifier
- $pcf_id : array<string|int, mixed>
-
Array of custom field identifiers
Return values
CollectiongetCFValue()
Get custom field value for a specific page and field.
public
getCFValue(int $page_id, int $pcf_id) : Collection
Retrieves all custom field data matching the given page_id and pcf_id.
Parameters
- $page_id : int
-
The page identifier
- $pcf_id : int
-
The custom field identifier