Page
extends Model
in package
uses
HasFactory
Page Model
This model manages page content and structure for the CICMS system. It stores comprehensive page information including content, metadata, media files, taxonomy, and various page types for content management.
Table of Contents
Properties
- $fillable : array<string|int, string>
- The attributes that are mass assignable.
Methods
- __construct() : void
- Create a new Page model instance.
- getFrontPageList() : Collection
- Get pages data based on page type with pagination and ordering.
- getFrontTotalCount() : int
- Get total count based on the page type slug string.
- getPageBySlug() : object
- This function used to get results based on the page type slug string
- getPageByTaxonomy() : Collection
- Get pages based on taxonomy data.
- getPestLibraryData() : Collection
- Get pest library data with limit.
- getTeamData() : Collection
- Get page data for team.
- updatePageInfo() : int
- Update page information based on page ID.
Properties
$fillable
The attributes that are mass assignable.
protected
array<string|int, string>
$fillable
= ['parent_page_id', 'page_alias', 'page_type', 'page_filename', 'page_title', 'page_desc', 'sort_by', 'page_status', 'page_pic', 'page_access', 'meta_title', 'meta_description', 'meta_keywords', 'external_link', 'draft_id', 'editor_type', 'pcm_slug', 'img_name', 'img_path', 'doc_name', 'video_name', 'video_type', 'video_id', 'video_date', 'taxonomy_data', 'taxonomy_tag', 'slide_id', 'psite_slug', 'post_excerpt', 'is_home', 'display_text', 'image', 'visibility', 'password', 'created_by', 'updated_by', 'created_at', 'updated_at']
Methods
__construct()
Create a new Page model instance.
public
__construct() : void
Sets the table name from configuration constants.
getFrontPageList()
Get pages data based on page type with pagination and ordering.
public
getFrontPageList(string $page_type, int $pageOffset[, int $limit = '' ][, string $orderbycolumn = 'sortby' ][, string $orderbyval = 'DESC' ]) : Collection
This function is used to get pages data based on page_type.
Parameters
- $page_type : string
-
The type of pages to retrieve
- $pageOffset : int
-
Pagination offset
- $limit : int = ''
-
Number of records to retrieve
- $orderbycolumn : string = 'sortby'
-
Column to order by
- $orderbyval : string = 'DESC'
-
Order direction (ASC/DESC)
Return values
Collection —Collection of pages
getFrontTotalCount()
Get total count based on the page type slug string.
public
getFrontTotalCount(string $page_type) : int
This function used to get total count based on the page type slug string.
Parameters
- $page_type : string
-
The page type slug
Return values
int —Total count of pages
getPageBySlug()
This function used to get results based on the page type slug string
public
getPageBySlug(mixed $pcmSlug) : object
Parameters
- $pcmSlug : mixed
Return values
object —: results object containing single row
getPageByTaxonomy()
Get pages based on taxonomy data.
public
getPageByTaxonomy(string $taxonomy_data) : Collection
This function is used to get pages based on taxonomy data.
Parameters
- $taxonomy_data : string
-
The taxonomy data to search for
Return values
Collection —Collection of matching pages
getPestLibraryData()
Get pest library data with limit.
public
getPestLibraryData(int $parent_id) : Collection
This function is used to get testimonial data with limit.
Parameters
- $parent_id : int
-
The parent page identifier
Return values
Collection —Collection of pest library pages
getTeamData()
Get page data for team.
public
getTeamData(string $slug) : Collection
This function is used to get page data for team.
Parameters
- $slug : string
-
The team slug
Return values
Collection —Collection of team pages
updatePageInfo()
Update page information based on page ID.
public
updatePageInfo(int $pageId, array<string|int, mixed> $pageInfo) : int
This function is used to update pages information based on page_id.
Parameters
- $pageId : int
-
The page identifier
- $pageInfo : array<string|int, mixed>
-
Array of page information to update
Return values
int —Number of affected rows