Skip to content

Calendar Model

Top-level scheduling container that owns event types, availability, and bookings for a host or resource.

Class

  • Source: fluent-booking/app/Models/Calendar.php
  • Table: fcal_calendars
  • Primary key: id
  • Extends: Model

Attributes

ColumnTypeNullableDefaultDescription
idBIGINT(20) UNSIGNED NOT NULL PRIMARY KEYYesPrimary key for the row.
hashVARCHAR(192)YesRandom hash used as a public, non-enumerable booking identifier.
user_idBIGINT(20) UNSIGNEDNoWordPress user ID associated with the row.
account_idBIGINT(20) UNSIGNEDYesForeign key to a related record.
parent_idBIGINT(20) UNSIGNEDYesParent row used for rescheduled or grouped bookings.
titleVARCHAR(192)NoHuman-readable title stored for the record.
slugVARCHAR(192)NoSanitized slug or public identifier.
media_idBIGINT(20) UNSIGNEDYesForeign key to a related record.
descriptionLONGTEXTYesDescription text stored for the record.
settingsLONGTEXTYesSerialized settings payload.
statusVARCHAR(20)NoactiveLifecycle status (scheduled, cancelled, completed, rejected, pending).
typeVARCHAR(20)NosimpleSubtype discriminator.
event_typeVARCHAR(20)Noschedulingsingle or group event.
account_typeVARCHAR(20)NofreeAccount Type stored for this record.
visibilityVARCHAR(20)NopublicVisibility stored for this record.
author_timezoneVARCHAR(192)YesUTCAuthor Timezone stored for this record.
max_book_per_slotINT(10) UNSIGNEDNo1Max Book Per Slot stored for this record.
created_atTIMESTAMPYesCreation timestamp maintained by the ORM.
updated_atTIMESTAMPYesUpdate timestamp maintained by the ORM.

Relationships

MethodTypeTarget
slots()hasManyCalendarSlot
events()hasManyCalendarSlot
user()belongsToUser
bookings()hasManyBooking
availabilities()hasManyAvailability
metas()hasManyMeta

Public Methods (sample)

MethodSignature
setSettingsAttribute()$settings
getSettingsAttribute()$settings
slots()
events()
user()
bookings()
availabilities()
metas()
isTeamCalendar()
isEventCalendar()
isHostCalendar()
updateEventOrder()$eventId
getAuthorPhoto()
getAuthorProfile()$public = true
getMeta()$key, $default = null
updateMeta()$key, $value
getLandingPageUrl()$isForce = false
getDirty()
getAllHosts()