ModelSites module

Environment

A model in the Sites module, with 17 members for templates, 14 API properties and 25 members for admin templates.

Sites\Models\Frontend\Environment Sites\Models\Api\Environment Sites\Models\Backend\Environment Also in Sites: CacheEntry CacheList CacheRecord Client Hostname Request Site SiteData 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 17

Take no arguments.

# isPrimary()
bool
Check whether this environment is the primary environment
# getLastVcsHash()
string
Fetches the last VCS hash for the environment. Returns the first 7 characters.
# getAnySiteLastVcsHash()
string
Fetches the last VCS hash the current environment, or (if this is empty) for any site's environment where the name matches the current environment. Returns the first 7 characters.
# getId()
?int
# getName()
?string
# getSitePath()
?string
# getRootEntity()
?string
Get the root entity associated with this environment
# getRootRecordId()
?int
Get the ID of the root record associated with this environment
# getPrimaryHostname()
?Hostname
# getVcsConfig()
?VcsConfig
# getClient()
?Client
# getSite()
?Site
# getHostnames()
?Collection<Hostname>
# getVcsLogs()
?Collection<VcsLog>
# 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 14

Read-only values on the record.

# primary
bool
Check whether this environment is the primary environment
# lastVcsHash
string
Fetches the last VCS hash for the environment. Returns the first 7 characters.
# anySiteLastVcsHash
string
Fetches the last VCS hash the current environment, or (if this is empty) for any site's environment where the name matches the current environment. Returns the first 7 characters.
# id
?int
# name
?string
# sitePath
?string
# rootEntity
?string
Get the root entity associated with this environment
# rootRecordId
?int
Get the ID of the root record associated with this environment
# primaryHostname
?Hostname
# vcsConfig
?VcsConfig
# client
?Client
# site
?Site
# hostnames
?Collection<Hostname>
# vcsLogs
?Collection<VcsLog>

Admin view

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

Properties 25

Take no arguments.

# isPrimary()
bool
Check whether this environment is the primary environment
# getLastVcsHash()
string
Fetches the last VCS hash for the environment. Returns the first 7 characters.
# getAnySiteLastVcsHash()
string
Fetches the last VCS hash the current environment, or (if this is empty) for any site's environment where the name matches the current environment. Returns the first 7 characters.
# getId()
?int
# getName()
?string
# getSitePath()
?string
# getRootEntity()
?string
Get the root entity associated with this environment
# getRootRecordId()
?int
Get the ID of the root record associated with this environment
# getPrimaryHostname()
?Hostname
# getVcsConfig()
?VcsConfig
# getClient()
?Client
# getSite()
?Site
# getHostnames()
?Collection<Hostname>
# getVcsLogs()
?Collection<VcsLog>
# 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
# getAvailableHostnames() Admin only
Collection
Get the available hostnames
# getAvailableRootEntities() Admin only
array
Get the entities supported to be added as root entities
# getHostnamesCount() Admin only
int
Get the number of hostnames for this environment.
# getVcsLogsCount() Admin only
int
Get the number of vcsLogs for this environment.
# getCreateChildUrl() Admin only
?string
Get the url for creating a child record.
# getEditUrl() Admin only
?string
Get the url for editing the record.
# getDeleteUrl() Admin only
?string
Get the url for deleting the record.