Skip to content

Certificate Model ​

An issued certificate, course or manual. Shares fcom_posts under type = course_certificate, with the credential ID in slug, the holder in user_id, the course in space_id and the template version in parent_id.

Table ​

  • Table: fcom_posts

  • Primary key: id

  • Extends: Model

Attributes ​

ColumnTypeNullableDefaultDescription
idBIGINT UNSIGNEDNo—Primary key for the row.
user_idBIGINT UNSIGNED, cast: intYes—WordPress user ID associated with the row.
parent_idBIGINT UNSIGNED, cast: intYes—Parent row ID used for threading or hierarchy.
titleVARCHAR(192)Yes—Human-readable title stored for the record.
slugVARCHAR(192)Yes—Sanitized slug or public identifier.
messageLONGTEXTYes—Raw message or body content.
message_renderedLONGTEXTYes—Rendered HTML representation of the message.
typeVARCHAR(100)Yes'feed'Subtype discriminator for the row.
content_typeVARCHAR(100)Yes'text'Content subtype such as text, document, or survey.
space_idBIGINT UNSIGNED, cast: intYes—Space ID stored for this record.
privacyVARCHAR(100)Yes'public'Visibility state used by feeds and spaces.
statusVARCHAR(100)Yes'published'Lifecycle or moderation status.
featured_imageTEXTYes—Featured Image stored for this record.
metaLONGTEXTYes—Serialized meta payload used by FluentCommunity.
is_stickyTINYINT(1)Yes0Boolean-like flag used for pinned or sticky records.
comments_countINT(11)Yes0Cached number of comments attached to the record.
reactions_countINT(11)Yes0Cached number of reactions attached to the record.
priorityINT(11), cast: intYes0Numeric priority used for pinned or featured ordering.
expired_atDATETIMEYes—Expired At stored for this record.
scheduled_atDATETIMEYes—Scheduled At stored for this record.
created_atTIMESTAMPYes—Creation timestamp maintained by the ORM.
updated_atTIMESTAMPYes—Update timestamp maintained by the ORM.

Relationships ​

MethodTypeTargetNotes
course()belongsToCourseSignature: —
user()belongsToUserSignature: —
template()belongsToCertificateTemplateSignature: —

Scopes ​

ScopeParametersPurpose
CourseCertificates$queryCourse Certificates scope declared on the model.
Manual$queryManual scope declared on the model.
ByHolderEmail$query, $emailBy Holder Email scope declared on the model.
ByCredential$query, $credentialIdBy Credential scope declared on the model.
Active$queryActive scope declared on the model.

Key Methods ​

MethodDescription
isManual()is Manual implemented on the model.
isExpired()is Expired implemented on the model.

Usage Examples ​

php
use FluentCommunityPro\App\Modules\Certificates\Models\Certificate;

$records = Certificate::query()
    ->courseCertificates()
    ->limit(10)
    ->get();

$first = Certificate::query()->first();

FluentCommunity developer documentation