ModelCustomEntities module

Record

A model in the CustomEntities module, with 65 members for templates, 46 API properties and 63 members for admin templates.

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

Take no arguments.

# __toString() Templates only
string
Returns the rendered HTML when the model is used in a string context.
# getName()
string
Get the name of the active revision of the record
# 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 of the definition.
# getOriginalFullSlug()
string
Get the original full slug without any custom urls applied to it
# getOriginalFullPath()
string
Get the original path for the record without any custom urls applied
# getUrl()
string
Get the url or path for the record. If the record belongs to a different site, this is respected in the returned url. This method will return the url using the primary environment and the primary hostname independently of the current environment the requests is viewed through.
# getAllRelationships() Not in API & Jobs
Collection
Get all relationships this record has, sorted by relationship definition position. One entry per definition. Also returns empty relationships for definitions where no record was linked.
# getAssignedWorkflow()
?Workflow
Get the workflow assigned to the record or entity
# hasAssignedWorkflow()
bool
Check whether the record has an assigned workflow
# getBranches()
Collection
Get the branches associated with the record
# getNumRevisionsWithoutBranch()
int
Get the number of revisions without branch
# getOriginalPath()
string
It's an alias and deprecated! Directly use getOriginalFullPath() instead.
# getFullSlug()
string
Gets the slug that addresses this record relative to its module — the portion of the URL that identifies the record itself, without the module path and without a leading slash. For a hierarchical record the slug includes the slugs of all of its ancestors joined with slashes. This is the effective slug: when a custom URL is set on the record, it _takes precedence and is returned_ here. The no-leading-slash shape describes the canonical value only. A custom URL is returned verbatim, and custom URLs are stored with a leading slash, so a record that has one returns /my-custom rather than my-custom; use getOriginalFullSlug() when you need the canonical shape unconditionally.
# getFullPath()
string
Gets the relative path that addresses this record within the site, including the module path and starting with a leading slash. This is the getFullSlug() value prefixed with the route under which the module is mounted. This is the effective path: when a custom URL is set on the record, it _takes precedence and is returned_ here. Returns an empty string when the record has no custom URL and getOriginalFullPath() cannot build one, so callers must treat an empty string as "no url" rather than as a path. Rendering it into markup or handing it to a cache or route helper would otherwise point the record at whatever the site serves at its root.
# getId()
?int
# getSlug()
?string
# getPosition()
?int
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getPublished()
?DateTime
# getDefinition()
?Definition
# getActiveRevision()
?RecordRevision
# getParent()
?Record
# getChildren()
?Collection<Record>
# getLanguage()
?Language
# getSite()
?Site
# isPublished()
bool
Determines if the record is published.
# getRevisions()
?Collection<RecordRevision>
# getRelationships() Not in API & Jobs
?Collection<Relationship>
# getInverseRelationships() Not in API & Jobs
?Collection<Relationship>
# getTags()
?Collection<Tag>
Tags associated with the page
# getCategories()
?Collection<Category>
Categories associated with the page
# getLastRevision()
?RecordRevision
# getFullPosition()
string
Get the full position for this record. Returns a flat position if the definition of the custom entity is not positioned.
# getCustomUrl()
?CustomUrl
Get the custom url used for the page. This will take precedence over the slugs of this page, parent page and the module.
# 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
# getEntityIdentifier() Templates only
string
Get the entity definition's identifier for this record
# getRecordTemplate() Templates only
?string
Get the template for the record if one was defined, or null
# getHtml() Templates only
string
Gets the rendered HTML for the record using its layout template.

Methods 23

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

# getBranchRevisions(RevisionBranch $branch, ?int $limit, ?int $offset)
Collection
Get the revisions for the provided branch, ordered by id ascending. Pass a limit/offset to fetch a bounded window instead of the full set — loading all revisions of a large branch exhausts memory.
# getNumBranchRevisions(RevisionBranch $branch)
int
Get the number of revisions for the provided branch (COUNT query — does not hydrate)
# getRevisionsWithoutBranch(?int $limit, ?int $offset)
Collection
Get the revisions without branch, ordered by id ascending. Pass a limit/offset to fetch a bounded window instead of the full set — loading all revisions of a record with a large history exhausts memory.
# getRevisionById(int $id)
?RecordRevision
# hasAreaWithName(string $areaName) Templates only
bool
Check if an area with the specified name exists for the active revision of the record
# getAreaType(string $areaName) Templates only
?InputType
Get the input type for the specified layout area, using the active revision of the record. Returns null if the area with the specified name could not be found.
# getAreaCategory(string $areaName) Templates only
?string
Get the category for the specified layout area, using the active revision of the record. Returns null if the area with the specified name could not be found.
# getAreaEditor(string $areaName) Templates only
?string
Get the editor for the specified layout area, using the active revision of the record. Returns null if the area with the specified name could not be found.
# getAreaImage(string $areaName) Templates only
?Image
Get the image for the layout area with the specified name, using the active revision of the record
# getAreaImageOrPlaceholder(string $areaName, int $width, int $height) Templates only
Image
Get the image for the component area with the specified name. Uses the active revision of the global component. 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).
# getAreaFile(string $areaName) Templates only
?File
Get the file for the layout area with the specified name, using the active revision of the record
# getAreaRecord(string $areaName) Templates only
?Model
Get the record for the layout area with the specified name, using the active revision of the record
# getAreaRecords(string $areaName) Templates only
?Collection
Get the records for the layout area with the specified name, using the active revision of the record
# getAreaText(string $areaName) Templates only
?string
Get the text for the layout area with the specified name, using the active revision of the record
# getAreaValues(string $areaName) Templates only
array
Get the values for the layout area with the specified name, using the active revision of the record
# getAreaDate(string $areaName) Templates only
?DateTime
Get a date for the layout area with the specified name, using the active revision of the record
# getAreaWidget(string $areaName) Templates only
?Widget
Get the widget for the layout area with the specified name, using the active revision of the record
# getAreaComponent(string $areaName) Templates only
?Component
Get the component for the layout area with the specified name, using the active revision of the record
# getAreaCollectionElements(string $areaName) Templates only
?Collection
Get the component collection elements for the layout area with the specified name, using the active revision of the record
# getAreaHtml(string $areaName) Templates only
string
Get the rendered HTML for the component area with the specified name, using the active revision of the record. Adds live preview tags, if enabled.
# getAreaDefaultContent(string $areaName) Templates only
?Content
Get the default content of the layout area. Uses the active revision of the global component. Will return a BlankContent if no content was defined.
# getAreaContentOrDefault(string $areaName) Templates only
?Content
Get the content of the layout area, or the default content if no content exists. Uses the active revision of the global component. If no default content exists, a BlankContent will be returned.
# isAreaBlank(string $areaName) Templates only
bool
Check whether the layout area with the specified name has no usable content, using the active revision of the record. Reports the area as blank when the record has no active revision. 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().

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 46

Read-only values on the record.

# name
string
Get the name of the active revision of the record
# 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 of the definition.
# originalFullSlug
string
Get the original full slug without any custom urls applied to it
# originalFullPath
string
Get the original path for the record without any custom urls applied
# url
string
Get the url or path for the record. If the record belongs to a different site, this is respected in the returned url. This method will return the url using the primary environment and the primary hostname independently of the current environment the requests is viewed through.
# showFrontendUrl Not in Templates
?string
# assignedWorkflow
?Workflow
Get the workflow assigned to the record or entity
# assignedWorkflow
bool
Check whether the record has an assigned workflow
# branches
Collection
Get the branches associated with the record
# numRevisionsWithoutBranch
int
Get the number of revisions without branch
# originalPath
string
It's an alias and deprecated! Directly use getOriginalFullPath() instead.
# fullSlug
string
Gets the slug that addresses this record relative to its module — the portion of the URL that identifies the record itself, without the module path and without a leading slash. For a hierarchical record the slug includes the slugs of all of its ancestors joined with slashes. This is the effective slug: when a custom URL is set on the record, it _takes precedence and is returned_ here. The no-leading-slash shape describes the canonical value only. A custom URL is returned verbatim, and custom URLs are stored with a leading slash, so a record that has one returns /my-custom rather than my-custom; use getOriginalFullSlug() when you need the canonical shape unconditionally.
# fullPath
string
Gets the relative path that addresses this record within the site, including the module path and starting with a leading slash. This is the getFullSlug() value prefixed with the route under which the module is mounted. This is the effective path: when a custom URL is set on the record, it _takes precedence and is returned_ here. Returns an empty string when the record has no custom URL and getOriginalFullPath() cannot build one, so callers must treat an empty string as "no url" rather than as a path. Rendering it into markup or handing it to a cache or route helper would otherwise point the record at whatever the site serves at its root.
# createChildUrl Not in Templates
?string
Get the url for creating a child record.
# showUrl Not in Templates
?string
Get the url for exporting a pdf for the record.
# editUrl Not in Templates
?string
Get the url for editing the record.
# manageUrl Not in Templates
?string
Get the url for managing records.
# moveUrl Not in Templates
?string
Get the url for moving the record.
# deleteUrl Not in Templates
?string
Get the url for deleting the record.
# permissionsUrl Not in Templates
?string
Get the url for editing the permissions of the record.
# checkPermissionsUrl Not in Templates
?string
Get the url for checking user permissions for this record.
# publishUrl Not in Templates
?string
Get the url for publishing the record.
# id
?int
# slug
?string
# position
?int
# created
?DateTime
Date the record was created.
# modified
?DateTime
Last modification date for the record.
# published
?DateTime
# definition
?Definition
# activeRevision
?RecordRevision
# parent
?Record
# children
?Collection<Record>
# language
?Language
# site
?Site
# published
bool
Determines if the record is published.
# tags
?Collection<Tag>
Tags associated with the page
# categories
?Collection<Category>
Categories associated with the page
# lastRevision
?RecordRevision
# fullPosition
string
Get the full position for this record. Returns a flat position if the definition of the custom entity is not positioned.
# customUrl
?CustomUrl
Get the custom url used for the page. This will take precedence over the slugs of this page, parent page and the module.
# externalId
?string
# relatedRecords API & Jobs only
RelationshipRecords
Get the related records for every relationship this entity has. For relationships that allow a single record, the record or null or returned. For relationships that allow multiple records, an array is returned.
# areasContent API & Jobs only
AreasContent
Get the areas content for the active revision

Admin view

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

Properties 56

Take no arguments.

# isSiteRequired() Admin only
bool
Determine whether the site is required from the custom entity definition
# getName()
string
Get the name of the active revision of the record
# 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 of the definition.
# getOriginalFullSlug()
string
Get the original full slug without any custom urls applied to it
# getOriginalFullPath()
string
Get the original path for the record without any custom urls applied
# getUrl()
string
Get the url or path for the record. If the record belongs to a different site, this is respected in the returned url. This method will return the url using the primary environment and the primary hostname independently of the current environment the requests is viewed through.
# getAllRelationships() Not in API & Jobs
Collection
Get all relationships this record has, sorted by relationship definition position. One entry per definition. Also returns empty relationships for definitions where no record was linked.
# getShowFrontendUrl() Not in Templates
?string
# isSupportingBranches() Admin only
bool
Checks whether the record supports branches
# getAssignedWorkflow()
?Workflow
Get the workflow assigned to the record or entity
# hasAssignedWorkflow()
bool
Check whether the record has an assigned workflow
# getBranches()
Collection
Get the branches associated with the record
# getNumRevisionsWithoutBranch()
int
Get the number of revisions without branch
# getOriginalPath()
string
It's an alias and deprecated! Directly use getOriginalFullPath() instead.
# getFullSlug()
string
Gets the slug that addresses this record relative to its module — the portion of the URL that identifies the record itself, without the module path and without a leading slash. For a hierarchical record the slug includes the slugs of all of its ancestors joined with slashes. This is the effective slug: when a custom URL is set on the record, it _takes precedence and is returned_ here. The no-leading-slash shape describes the canonical value only. A custom URL is returned verbatim, and custom URLs are stored with a leading slash, so a record that has one returns /my-custom rather than my-custom; use getOriginalFullSlug() when you need the canonical shape unconditionally.
# getFullPath()
string
Gets the relative path that addresses this record within the site, including the module path and starting with a leading slash. This is the getFullSlug() value prefixed with the route under which the module is mounted. This is the effective path: when a custom URL is set on the record, it _takes precedence and is returned_ here. Returns an empty string when the record has no custom URL and getOriginalFullPath() cannot build one, so callers must treat an empty string as "no url" rather than as a path. Rendering it into markup or handing it to a cache or route helper would otherwise point the record at whatever the site serves at its root.
# getCreateChildUrl() Not in Templates
?string
Get the url for creating a child record.
# getShowUrl() Not in Templates
?string
Gets a "show" URL. Can be disabled.
# getEditUrl() Not in Templates
?string
Get the url for editing the record.
# getManageUrl() Not in Templates
?string
Get the url for managing records.
# getMoveUrl() Not in Templates
?string
Get the url for moving the record.
# getDeleteUrl() Not in Templates
?string
Get the url for deleting the record.
# getPermissionsUrl() Not in Templates
?string
Get the url for editing the permissions of the record.
# getCheckPermissionsUrl() Not in Templates
?string
Get the url for checking user permissions for this record.
# getPublishUrl() Not in Templates
?string
Get the url for publishing the record.
# getId()
?int
# getSlug()
?string
# getPosition()
?int
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getPublished()
?DateTime
# getDefinition()
?Definition
# getActiveRevision()
?RecordRevision
# getParent()
?Record
# getChildren()
?Collection<Record>
# getLanguage()
?Language
# getSite()
?Site
# isPublished()
bool
Determines if the record is published.
# getRevisions()
?Collection<RecordRevision>
# getRelationships() Not in API & Jobs
?Collection<Relationship>
# getInverseRelationships() Not in API & Jobs
?Collection<Relationship>
# getTags()
?Collection<Tag>
Tags associated with the page
# getCategories()
?Collection<Category>
Categories associated with the page
# getLastRevision()
?RecordRevision
# getFullPosition()
string
Get the full position for this record. Returns a flat position if the definition of the custom entity is not positioned.
# getCustomUrl()
?CustomUrl
Get the custom url used for the page. This will take precedence over the slugs of this page, parent page and the module.
# 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
# getEditBreadcrumbs() Admin only
string
Get the breadcrumbs to display while editing the record
# getDefaultLanguage() Admin only
Language
Gets the default language for the record.
# getSupportedLanguages() Admin only
Collection
Gets the supported languages.
# getAvailableSaveNewActions() Admin only
array
Get the actions available for saving a new version of the record. Determined whether an active revision can be set directly, and in which order the actions should be returned.

Methods 7

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

# getBranchRevisions(RevisionBranch $branch, ?int $limit, ?int $offset)
Collection
Get the revisions for the provided branch, ordered by id ascending. Pass a limit/offset to fetch a bounded window instead of the full set — loading all revisions of a large branch exhausts memory.
# getNumBranchRevisions(RevisionBranch $branch)
int
Get the number of revisions for the provided branch (COUNT query — does not hydrate)
# getRevisionsWithoutBranch(?int $limit, ?int $offset)
Collection
Get the revisions without branch, ordered by id ascending. Pass a limit/offset to fetch a bounded window instead of the full set — loading all revisions of a record with a large history exhausts memory.
# getRevisionById(int $id)
?RecordRevision
# getAvailableSaveActions(?Model $currentRevision) Admin only
array
Get the save actions available for the record and provided revision being edited
# getRevisionActions(Revision $revision, ?Revision $currentRevision) Admin only
array
Get the actions available for the provided revision
# getUpdateRevisionId(Revision $revision) Admin only
?int
Get the revision ID to use when updating the record. If the provided revision is a draft, the previous id is returned, if one exists.