ModelCustomEntities module

RecordRevision

Revision

A model in the CustomEntities module, with 42 members for templates, 17 API properties and 41 members for admin templates.

CustomEntities\Models\Frontend\RecordRevision CustomEntities\Models\Api\RecordRevision CustomEntities\Models\Backend\RecordRevision Also in CustomEntities: Definition Record RecordArea Relationship RelationshipDefinition
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 18

Take no arguments.

# isActiveRevision()
bool
Check if the revision is the active revision
# getLayout()
?Layout
Get the layout for the record revision. Since custom entity records use a layout defined on the definition level, this returns the same layout for all records and revisions of the definition.
# getAreas()
?Collection
# getAreaGroups()
?Collection
Gets the layout area groups
# getId()
?int
# getName()
?string
# getType()
?string
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getRecord()
?Record
# getSeoSettings()
?SeoSettings
# getBranch()
?RevisionBranch
# getCreatedBy()
?User
# getModifiedBy()
?User
# getRecordAreas()
?Collection<RecordArea>
# 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

Methods 24

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

# getAreaContent(string $areaName)
Content
Get the content of the layout area Will return a BlankContent if no content was defined
# getAreaDefaultContent(string $areaName)
Content
Get the default content of the layout area Will return a BlankContent if no content was defined
# getAreaContentOrDefault(string $areaName)
Content
Get the content of the layout area, or the default content if no content exists If no default content exists, a BlankContent will be returned
# isAreaBlank(string $areaName)
bool
Check whether the layout area with the specified name has no usable content. Resolves the area's content, falling back to its default, and reports the area as blank when no content exists at all, when the content is one of the framework's Blank objects, or when the content is empty for its category. Blank describes what is stored, not what renders: the answer comes from the stored content and never renders a template. An area can therefore be not blank and still render nothing — a record that was deleted or has no layout, a component or widget whose template outputs nothing, or text whose only content is a placeholder for a deleted image. To decide on the rendered output instead, test the result of getAreaHtml(). Emptiness cannot always be determined — Content::isEmpty() throws a RuntimeException when the content has no input type, or when its category is not one the framework knows how to answer for. Those two cases are reported as not blank, the same answer the Twig empty test gives. Any other failure, such as a database error, is not contained and reaches the error handler.
# getAreaAttributesContent(string $areaName)
array
Gets the content of every layout area attribute. If layout area does not have attributes, returns empty array.
# getAreaAttributesDefaultContent(string $areaName)
array
Gets the default content of every layout area attribute. If layout area does not have attributes, returns empty array.
# getAreaAttributesContentOrDefault(string $areaName)
array
Gets the content (or the default content if no content exists) of every layout area attribute. If layout area does not have attributes, returns empty array.
# getEntityAreaByLayoutArea(LayoutArea $area)
?Model
Get the link record between the layout area and content for the designated layout area
# hasAreaWithName(string $areaName)
bool
Check if an area with the specified name exists for the container
# getAreaType(string $areaName)
?InputType
Get the input type for the specified layout area. Returns null if the area with the specified name could not be found.
# getAreaCategory(string $areaName)
?string
Get the category for the specified layout area. Returns null if the area with the specified name could not be found.
# getAreaEditor(string $areaName)
?string
Get the editor for the specified layout area. Returns null if the area with the specified name could not be found.
# getAreaImage(string $areaName)
Image
Get the image for the layout area with the specified name Will return a BlankImage if no image was defined
# getAreaFile(string $areaName)
?File
Get the file for the layout area with the specified name
# getAreaRecord(string $areaName)
?Model
Get the record for the layout area with the specified name
# getAreaRecords(string $areaName)
?Collection
Get the records for the layout area with the specified name
# getAreaText(string $areaName)
?string
Get the text for the layout area with the specified name
# getAreaValues(string $areaName)
array
Get the values for the layout area with the specified name
# getAreaDate(string $areaName)
?DateTime
Get a date for the layout area with the specified name
# getAreaWidget(string $areaName)
Widget
Get the widget for the layout area with the specified name Will return a BlankWidget if no image was defined
# getAreaComponent(string $areaName)
Component
Get the component for the layout area with the specified name Will return a BlankComponent if no image was defined
# getAreaCollectionElements(string $areaName)
?Collection
Get the component collection elements for the layout area with the specified name
# getAreaHtml(string $areaName)
string
Get the rendered HTML for the component area with the specified name. Adds live preview tags, if enabled.
# getAreaImageOrPlaceholder(string $areaName, int $width, int $height) Templates only
Image
Get the image for the component area with the specified name If the image does not exist, get a placeholder image with the specified dimensions Will always return an image, even if it was not found (in that case, an empty image)

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 17

Read-only values on the record.

# allRelationships API & Jobs only
array
Get all relationships for the record, indexed by identifier
# activeRevision
bool
Check if the revision is the active revision
# layout
?Layout
Get the layout for the record revision. Since custom entity records use a layout defined on the definition level, this returns the same layout for all records and revisions of the definition.
# areas
?Collection
# areaGroups
?Collection
Gets the layout area groups
# id
?int
# name
?string
# type
?string
# created
?DateTime
Date the record was created.
# modified
?DateTime
Last modification date for the record.
# record
?Record
# seoSettings
?SeoSettings
# branch
?RevisionBranch
# createdBy
?User
# modifiedBy
?User
# recordAreas
?Collection<RecordArea>
# areasContent API & Jobs only
AreasContent
Fetch content for all layout areas defined for the model as AreasContent object

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.

# isActiveRevision()
bool
Check if the revision is the active revision
# getLayout()
?Layout
Get the layout for the record revision. Since custom entity records use a layout defined on the definition level, this returns the same layout for all records and revisions of the definition.
# getAreas()
?Collection
# getAreaGroups()
?Collection
Gets the layout area groups
# getId()
?int
# getName()
?string
# getType()
?string
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getRecord()
?Record
# getSeoSettings()
?SeoSettings
# getBranch()
?RevisionBranch
# getCreatedBy()
?User
# getModifiedBy()
?User
# getRecordAreas()
?Collection<RecordArea>
# 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

Methods 23

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

# getAreaContent(string $areaName)
?Content
Get the content of the layout area
# getAreaDefaultContent(string $areaName)
?Content
Get the default content of the layout area
# getAreaContentOrDefault(string $areaName)
?Content
Get the content of the layout area, or the default content if no content exists
# isAreaBlank(string $areaName)
bool
Check whether the layout area with the specified name has no usable content. Resolves the area's content, falling back to its default, and reports the area as blank when no content exists at all, when the content is one of the framework's Blank objects, or when the content is empty for its category. Blank describes what is stored, not what renders: the answer comes from the stored content and never renders a template. An area can therefore be not blank and still render nothing — a record that was deleted or has no layout, a component or widget whose template outputs nothing, or text whose only content is a placeholder for a deleted image. To decide on the rendered output instead, test the result of getAreaHtml(). Emptiness cannot always be determined — Content::isEmpty() throws a RuntimeException when the content has no input type, or when its category is not one the framework knows how to answer for. Those two cases are reported as not blank, the same answer the Twig empty test gives. Any other failure, such as a database error, is not contained and reaches the error handler.
# getAreaAttributesContent(string $areaName)
array
Gets the content of every layout area attribute. If layout area does not have attributes, returns empty array.
# getAreaAttributesDefaultContent(string $areaName)
array
Gets the default content of every layout area attribute. If layout area does not have attributes, returns empty array.
# getAreaAttributesContentOrDefault(string $areaName)
array
Gets the content (or the default content if no content exists) of every layout area attribute. If layout area does not have attributes, returns empty array.
# getEntityAreaByLayoutArea(LayoutArea $area)
?Model
Get the link record between the layout area and content for the designated layout area
# hasAreaWithName(string $areaName)
bool
Check if an area with the specified name exists for the container
# getAreaType(string $areaName)
?InputType
Get the input type for the specified layout area. Returns null if the area with the specified name could not be found.
# getAreaCategory(string $areaName)
?string
Get the category for the specified layout area. Returns null if the area with the specified name could not be found.
# getAreaEditor(string $areaName)
?string
Get the editor for the specified layout area. Returns null if the area with the specified name could not be found.
# getAreaImage(string $areaName)
?Image
Get the image for the layout area with the specified name
# getAreaFile(string $areaName)
?File
Get the file for the layout area with the specified name
# getAreaRecord(string $areaName)
?Model
Get the record for the layout area with the specified name
# getAreaRecords(string $areaName)
?Collection
Get the records for the layout area with the specified name
# getAreaText(string $areaName)
?string
Get the text for the layout area with the specified name
# getAreaValues(string $areaName)
array
Get the values for the layout area with the specified name
# getAreaDate(string $areaName)
?DateTime
Get a date for the layout area with the specified name
# getAreaWidget(string $areaName)
?Widget
Get the widget for the layout area with the specified name
# getAreaComponent(string $areaName)
?Component
Get the component for the layout area with the specified name
# getAreaCollectionElements(string $areaName)
?Collection
Get the component collection elements for the layout area with the specified name
# getAreaHtml(string $areaName)
string
Get the rendered HTML for the component area with the specified name. Adds live preview tags, if enabled.