ModelCommon module

Layout

A model in the Common module, with 32 members for templates, 19 API properties and 40 members for admin templates.

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 22

Take no arguments.

# getId()
?int
# getController()
?string
# getTemplate()
?string
# getName()
?string
# getIdentifier()
?string
# getText()
?string
# getCreated()
?DateTime
Get the date the record was created.
# getModified()
?DateTime
Get the last modification date for the record.
# isHidden()
bool
# getHidden()
?DateTime
# getSite()
?Site
# getAreas()
?Collection<LayoutArea>
# getAreaGroups()
?Collection<LayoutAreaGroup>
# getImage()
?Image
# getCategory()
?LayoutCategory
# getCustomFieldValues()
?Collection<LayoutCustomFieldValue>
# getCustomFields()
array
Get the custom fields for this entity
# getExternalId()
?string
# 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
# hasExistingTemplate() Templates only
bool
Check if the template associated with this layout exists for the current site

Methods 10

Take arguments. The API serialises only getters that need none.

# getAreaByName(string $areaName)
?LayoutArea
Fetch a layout area with the given name
# getCustomFieldValue(CustomField $customField)
?CustomFieldValue
Get the value for a custom field
# getCustomFieldValueByName(string $customFieldName)
?CustomFieldValue
Get the value for a custom field by the custom field name
# getCustomFieldContent(string $customFieldName)
?Content
Get the content for the custom field identified by the specified name
# getCustomFieldContentOrDefault(string $customFieldName)
?Content
Get the (default) content for the custom field identified by the specified name
# getCustomFieldBoolean(string $customFieldName, ?bool $default)
?bool
Get the (default) content of the custom field as boolean value
# getCustomFieldText(string $customFieldName, ?string $default)
?string
Get the (default) content of the custom field as text
# getCustomFieldImage(string $customFieldName)
?Image
Get the (default) image contained in the custom field
# getCustomFieldFile(string $customFieldName)
?File
Get the (default) file contained in the custom field
# hasCustomField(string $customFieldName)
bool
Check if the entity has a custom field with the specified name

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 19

Read-only values on the record.

# id
?int
# controller
?string
# template
?string
# name
?string
# identifier
?string
# text
?string
# created
?DateTime
Get the date the record was created.
# modified
?DateTime
Get the last modification date for the record.
# hidden
bool
# hidden
?DateTime
# site
?Site
# image
?Image
# category
?LayoutCategory
# customFieldValues
?Collection<LayoutCustomFieldValue>
# customFieldContent
object
Get a serialized representation of the custom fields associated with the record
# customFields
array
Get the custom fields for this entity
# externalId
?string

Admin view

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

Properties 30

Take no arguments.

# getId()
?int
# getController()
?string
# getTemplate()
?string
# getName()
?string
# getIdentifier()
?string
# getText()
?string
# getCreated()
?DateTime
Get the date the record was created.
# getModified()
?DateTime
Get the last modification date for the record.
# isHidden()
bool
# getHidden()
?DateTime
# getSite()
?Site
# getAreas()
?Collection<LayoutArea>
# getAreaGroups()
?Collection<LayoutAreaGroup>
# getImage()
?Image
# getCategory()
?LayoutCategory
# getCustomFieldValues()
?Collection<LayoutCustomFieldValue>
# getCustomFields()
array
Get the custom fields for this entity
# getExternalId()
?string
# 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
# getAvailableInputTypes() Admin only
Collection
Get the available input types
# getRootCategories() Admin only
Collection
Get the root layout categories
# getAvailableTemplates() Admin only
array
Get the available templates
# hasAttributes() Admin only
bool
Checks whether the layout has attributes (visible, not hidden) without attachment to a layout area
# getAttributes() Admin only
Collection
Check whether the layout has attributes without attachment to a layout area
# getDuplicateUrl() Admin only
?string
Get the url for duplicating the record.
# getEditUrl() Admin only
?string
Get the url for editing the record.
# getManageUrl() Admin only
?string
Get the url for managing records.

Methods 10

Take arguments. The API serialises only getters that need none.

# getAreaByName(string $areaName)
?LayoutArea
Fetch a layout area with the given name
# getCustomFieldValue(CustomField $customField)
?CustomFieldValue
Get the value for a custom field
# getCustomFieldValueByName(string $customFieldName)
?CustomFieldValue
Get the value for a custom field by the custom field name
# getCustomFieldContent(string $customFieldName)
?Content
Get the content for the custom field identified by the specified name
# getCustomFieldContentOrDefault(string $customFieldName)
?Content
Get the (default) content for the custom field identified by the specified name
# getCustomFieldBoolean(string $customFieldName, ?bool $default)
?bool
Get the (default) content of the custom field as boolean value
# getCustomFieldText(string $customFieldName, ?string $default)
?string
Get the (default) content of the custom field as text
# getCustomFieldImage(string $customFieldName)
?Image
Get the (default) image contained in the custom field
# getCustomFieldFile(string $customFieldName)
?File
Get the (default) file contained in the custom field
# hasCustomField(string $customFieldName)
bool
Check if the entity has a custom field with the specified name