ModelSites module

SiteData

Site

A model in the Sites module, with 12 members for templates, 9 API properties and 18 members for admin templates.

Sites\Models\Frontend\SiteData Sites\Models\Api\SiteData Sites\Models\Backend\SiteData Also in Sites: CacheEntry CacheList CacheRecord Client Environment Hostname Request Site VcsConfig VcsLog
View
What Smarty and Twig templates receive. Properties in REST API responses and job payloads. What admin screen templates receive when you override them.

Templates view

Properties 12

Take no arguments.

# getId()
?int
# getKey()
?string
# getCreated()
?DateTime
Get the date the record was created.
# getModified()
?DateTime
Get the last modification date for the record.
# getCreatedBy()
?User
# getClient()
?Client
# getSite()
?Site
Site associated with the site data
# getContent()
?mixed
Get content from the site data
# getType()
string
Get type of the content; either json or scalar
# isNewRecord() Not in API & Jobs
bool
Check if the record is a new record
# isHierarchicalModel() Not in API & Jobs
bool
Check whether a model is a hierarchical model, i.e. can have children
# isVersionedModel() Not in API & Jobs
bool
Check whether a model is versioned

API & Jobs view

API & JobsEach property is a key in REST API responses and job payloads. Its name is the template getter without get, is or has. Methods that need arguments are not available here.

Properties 9

Read-only values on the record.

# id
?int
# key
?string
# created
?DateTime
Get the date the record was created.
# modified
?DateTime
Get the last modification date for the record.
# createdBy
?User
# client
?Client
# site
?Site
Site associated with the site data
# content
?mixed
Get content from the site data
# type
string
Get type of the content; either json or scalar

Admin view

AdminAvailable in cdna-admin templates. Copy an admin template into your site repository to change how this record is edited.

Properties 18

Take no arguments.

# getId()
?int
# getKey()
?string
# getCreated()
?DateTime
Get the date the record was created.
# getModified()
?DateTime
Get the last modification date for the record.
# getCreatedBy()
?User
# getClient()
?Client
# getSite()
?Site
Site associated with the site data
# getContent()
?string
Encode JSON content as string before delivering it
# getType()
string
Get type of the content; either json or scalar
# isNewRecord() Not in API & Jobs
bool
Check if the record is a new record
# isHierarchicalModel() Not in API & Jobs
bool
Check whether a model is a hierarchical model, i.e. can have children
# isVersionedModel() Not in API & Jobs
bool
Check whether a model is versioned
# getContentPreview() Admin only
string
Get a preview of the content
# getEditUrl() Admin only
?string
Get the url for editing the record.
# getDeleteUrl() Admin only
?string
Get the url for deleting the record.
# getPermissionsUrl() Admin only
?string
Get the url for editing the permissions of the record.
# getCheckPermissionsUrl() Admin only
?string
Get the url for checking user permissions for this record.