ModelCommon module

WidgetSetting

A model in the Common module, with 12 members for templates, 9 API properties and 22 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 12

Take no arguments.

# getEditor()
?string
# getId()
?int
# getKey()
?string
# getType()
?string
# getValue()
?string
# getWidget()
?Widget
# isRequired()
?bool
# getRegex()
?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

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 9

Read-only values on the record.

# editor
?string
# id
?int
# key
?string
# type
?string
# value
?string
# widget
?Widget
# required
?bool
# regex
?string

Admin view

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

Properties 21

Take no arguments.

# getEditor()
?string
# getId()
?int
# getKey()
?string
# getType()
?string
# getValue()
?string
# getWidget()
?Widget
# isRequired()
?bool
# getRegex()
?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
# getDescription() Admin only
?string
# getHelp() Admin only
?string
# getPossibleValues() Admin only
?array
# getAvailableModels() Admin only
?Collection
# getDisplayProperty() Admin only
?string
# getDefaultValue() Admin only
?mixed
# isUserSettable() Admin only
bool
# getEntity() Admin only
?string
# getCleanRegex() Admin only
string
Gets HTML encoded regex. NOTE in JS and HTML we don't need delimiters (e.g., / or ~) at the start and end, nor trailing modifiers (e.g., i, m). This method detects and strips them if present, extracting the raw pattern.

Methods 1

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

# getDefaultValueAsString(string $separator) Admin only
?string
Get the default value as a string