ModelCommon module
GlobalComponent
A model in the Common module, with 58 members for templates, 26 API properties and 64 members for admin templates.
Templates view
Properties 29
Take no arguments.
-
#
getComponentAreas() -
Collection - Get the component areas from the active revision Uses the active revision of the global component.
-
#
getNumUsedInContent() -
int - Determine how often this global component has been used in the content (or component collections)
-
#
getId() -
?int -
#
getName() -
?string -
#
getIdentifier() -
?string -
#
getHidden() -
?DateTime -
#
getActiveRevision() -
?GlobalComponentRevision -
#
getRevisions() -
?Collection<GlobalComponentRevision> -
#
getLastRevision() -
?GlobalComponentRevision - Get the last revision for the entity. If a revision has been added, this will be the newly added revision.
-
#
getCopiedComponents() -
?Collection<Component> -
#
getTags() -
?Collection<Tag> -
#
getCategories() -
?Collection<Category> -
#
isHierarchicalModel()Not in API & Jobs -
bool - Check whether a model is a hierarchical model, i.e. can have children
Methods 29
Take arguments. The API serialises only getters that need none.
-
#
getHtml(array $variables) -
string - Get the rendered html content for this component. Uses the active revision of the global component.
-
#
getAreaType(string $areaName) -
?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) -
?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) -
?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) -
?Image - Get the image for the layout area with the specified name, using the active revision of the record
-
#
getAreaRecord(string $areaName) -
?Model - Get the record for the layout area with the specified name, using the active revision of the record
-
#
getAreaRecords(string $areaName) -
?Collection - Get the records for the layout area with the specified name, using the active revision of the record
-
#
getAreaText(string $areaName) -
?string - Get the text for the layout area with the specified name, using the active revision of the record
-
#
getAreaValues(string $areaName) -
array - Get the values for the layout area with the specified name, using the active revision of the record
-
#
getAreaHtml(string $areaName) -
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.
-
#
getAreaDate(string $areaName) -
?DateTime - Get a date for the layout area with the specified name, using the active revision of the record
-
#
getAreaWidget(string $areaName) -
?Widget - Get the widget for the layout area with the specified name, using the active revision of the record
-
#
getAreaComponent(string $areaName) -
?Component - Get the component for the layout area with the specified name, using the active revision of the record
-
#
getAreaCollectionElements(string $areaName) -
?Collection - Get the component collection elements for the layout area with the specified name, using the active revision of the record
-
#
getAreaContent(string $areaName) -
?Content - Get the content of the component area Uses the active revision of the global component.
-
#
getAreaDefaultContent(string $areaName) -
?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) -
?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) -
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().
-
#
getAreaAttributesContent(string $areaName) -
array - Gets the content of every layout area attribute. If layout area does not have attributes, returns empty array. Uses the active revision of the global component.
-
#
getAreaAttributesDefaultContent(string $areaName) -
array - Gets the default content of every layout area attribute. If layout area does not have attributes, returns empty array. Uses the active revision of the global component.
-
#
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. Uses the active revision of the global component.
-
#
getEntityAreaByLayoutArea(LayoutArea $area) -
?Model - Get the link record between the layout area and content for the designated layout area. Uses the active revision of the global component.
-
#
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.
-
#
hasAreaWithName(string $areaName)Templates only -
bool - Check if an area with the specified name exists for 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).
No members match the filter.
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 26
Read-only values on the record.
-
#
componentAreas -
Collection - Get the component areas from the active revision Uses the active revision of the global component.
-
#
numUsedInContent -
int - Determine how often this global component has been used in the content (or component collections)
-
#
id -
?int -
#
name -
?string -
#
identifier -
?string -
#
activeRevision -
?GlobalComponentRevision -
#
revisions -
?Collection<GlobalComponentRevision> -
#
lastRevision -
?GlobalComponentRevision - Get the last revision for the entity. If a revision has been added, this will be the newly added revision.
-
#
copiedComponents -
?Collection<Component> -
#
tags -
?Collection<Tag> -
#
categories -
?Collection<Category>
No members match the filter.
Admin view
AdminAvailable in cdna-admin templates. Copy an admin template into your site repository to change how this record is edited.
Properties 34
Take no arguments.
-
#
getComponentAreas() -
Collection - Get the component areas from the active revision Uses the active revision of the global component.
-
#
getNumUsedInContent() -
int - Determine how often this global component has been used in the content (or component collections)
-
#
getId() -
?int -
#
getName() -
?string -
#
getIdentifier() -
?string -
#
getHidden() -
?DateTime -
#
getActiveRevision() -
?GlobalComponentRevision -
#
getRevisions() -
?Collection<GlobalComponentRevision> -
#
getLastRevision() -
?GlobalComponentRevision - Get the last revision for the entity. If a revision has been added, this will be the newly added revision.
-
#
getCopiedComponents() -
?Collection<Component> -
#
getTags() -
?Collection<Tag> -
#
getCategories() -
?Collection<Category> -
#
isHierarchicalModel()Not in API & Jobs -
bool - Check whether a model is a hierarchical model, i.e. can have children
-
#
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 30
Take arguments. The API serialises only getters that need none.
-
#
getHtml(array $variables) -
string - Get the rendered html content for this component. Uses the active revision of the global component.
-
#
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. Uses the active revision of the global component.
-
#
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. Uses the active revision of the global component.
-
#
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. Uses the active revision of the global component.
-
#
getAreaImage(string $areaName) -
?Image - Get the image for the component area with the specified name Uses the active revision of the global component.
-
#
getAreaRecord(string $areaName) -
?Model - Get the record for the layout area with the specified name. Uses the active revision of the global component.
-
#
getAreaRecords(string $areaName) -
?Collection - Get the records for the layout area with the specified name. Uses the active revision of the global component.
-
#
getAreaText(string $areaName) -
?string - Get the text for the component area with the specified name Uses the active revision of the global component.
-
#
getAreaValues(string $areaName) -
array - Get the values for the component area with the specified name. Uses the active revision of the global component.
-
#
getAreaHtml(string $areaName) -
?string - Get the html for the component area with the specified name Uses the active revision of the global component.
-
#
getAreaDate(string $areaName) -
?DateTime - Get a date for the layout area with the specified name Uses the active revision of the global component.
-
#
getAreaWidget(string $areaName) -
?Widget - Get the widget for the component area with the specified name Uses the active revision of the global component.
-
#
getAreaComponent(string $areaName) -
?Component - Get the component for the layout area with the specified name. Uses the active revision of the global component.
-
#
getAreaCollectionElements(string $areaName) -
?Collection - Get the component collection elements for the layout area with the specified name. Uses the active revision of the global component.
-
#
getAreaContent(string $areaName) -
?Content - Get the content of the component area Uses the active revision of the global component.
-
#
getAreaDefaultContent(string $areaName) -
?Content - Get the default content of the component area Uses the active revision of the global component.
-
#
getAreaContentOrDefault(string $areaName) -
?Content - Get the content of the component area, or the default content if no content exists Uses the active revision of the global component.
-
#
isAreaBlank(string $areaName) -
bool - Check whether the component area with the specified name has no usable content. Uses the active revision of the global component. 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().
-
#
getAreaAttributesContent(string $areaName) -
array - Gets the content of every layout area attribute. If layout area does not have attributes, returns empty array. Uses the active revision of the global component.
-
#
getAreaAttributesDefaultContent(string $areaName) -
array - Gets the default content of every layout area attribute. If layout area does not have attributes, returns empty array. Uses the active revision of the global component.
-
#
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. Uses the active revision of the global component.
-
#
getEntityAreaByLayoutArea(LayoutArea $area) -
?Model - Get the link record between the layout area and content for the designated layout area. Uses the active revision of the global component.
-
#
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.
-
#
getComponentAreaByLayoutArea(LayoutArea $area)Admin only -
?GlobalComponentRevisionArea - Get the link record between the layout area and content for the designated layout area. Uses the active revision to get the result
-
#
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.
No members match the filter.