ModelCommon module

Widget

A model in the Common module, with 21 members for templates, 14 API properties and 28 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 17

Take no arguments.

# isBlank()
bool
Return the information that this is not a blank widget
# getId()
?int
# getModule()
?string
# getText()
?string
# getConfigName()
?string
# getName()
?string
# getIdentifier()
?string
# getController()
?string
# getMethod()
?string
# getCreated()
?DateTime
# getModified()
?DateTime
# getSite()
?Site
# getLayout()
?Layout
# getSettings()
?Collection<WidgetSetting>
# 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 4

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

# getResponse(array $parameters, bool $removeExisting)
Response
Get the Response produced from controller calls for this widget. Does not render the template yet.
# getSettingValue(string $settingName)
?string
Get the value for a setting for this widget
# getSettingValues(string $settingName)
?Collection
Get the values for a setting for this widget
# getHtml(array $parameters, bool $removeExisting)
string
Get the rendered html content for this widget

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.

# blank
bool
Return the information that this is not a blank widget
# id
?int
# module
?string
# text
?string
# configName
?string
# name
?string
# identifier
?string
# controller
?string
# method
?string
# created
?DateTime
# modified
?DateTime
# site
?Site
# layout
?Layout

Admin view

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

Properties 23

Take no arguments.

# isBlank()
bool
Return the information that this is not a blank widget
# getId()
?int
# getModule()
?string
# getText()
?string
# getConfigName()
?string
# getName()
?string
# getIdentifier()
?string
# getController()
?string
# getMethod()
?string
# getCreated()
?DateTime
# getModified()
?DateTime
# getSite()
?Site
# getLayout()
?Layout
# getSettings()
?Collection<WidgetSetting>
# 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
# getAvailableSettings() Admin only
array
# getAvailableLayouts() Admin only
Collection
Get the available layouts
# getEditUrl() Admin only
?string
Get the url for editing the record.
# getDeleteUrl() Admin only
?string
Get the url for deleting the record.
# getManageUrl() Admin only
?string
Get the url for managing records.

Methods 5

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

# getSettingValue(string $settingName)
?string
Get the value for a setting for this widget
# getSettingValues(string $settingName)
?Collection
Get the values for a setting for this widget
# getHtml(array $parameters, bool $removeExisting)
string
Get the rendered html content for this widget
# getResponse(array $parameters, bool $removeExisting)
Response
Get the Response produced from controller calls for this widget. Does not render the template yet.
# getSettingWithKey(string $key) Admin only
?WidgetSetting
Get a setting with the specified key for this widget