ModelForms module
Form
A model in the Forms module, with 45 members for templates, 27 API properties and 53 members for admin templates.
Templates view
Properties 31
Take no arguments.
-
#
__toString()Templates only -
string - Returns the rendered HTML when the model is used in a string context.
-
#
hasFileInput() -
bool - Returns whether form has InputFile at any step. This method can be used to decide whether to add
enctype="multipart/form-data"to form. -
#
getSteps() -
?Collection - Get the steps for the active revision of the form. Returns null if the form does not have an active revision.
-
#
getElements() -
?Collection - Get the elements for the active revision of the form. Returns null if the form does not have an active revision.
-
#
getId() -
?int -
#
getName() -
?string -
#
getIdentifier() -
?string -
#
getPublished() -
?DateTime -
#
getActiveRevision() -
?FormRevision -
#
getRevisions() -
?Collection<FormRevision> -
#
getLastRevision() -
?Model -
#
getCustomFieldValues() -
?Collection<FormCustomFieldValue> -
#
getExternalId() -
?string -
#
isHierarchicalModel()Not in API & Jobs -
bool - Check whether a model is a hierarchical model, i.e. can have children
-
#
getCurrentStep()Templates only -
?Step - Get the step to be rendered for the form, depending on the current state of the submission.
-
#
getIdPrefix()Templates only -
string - Returns the prefix that is applied to the ids for any elements of this form
Methods 14
Take arguments. The API serialises only getters that need none.
-
#
setIdPrefix(string $prefix)Templates only -
void - Sets the prefix that should be applied to the ids for any elements of this form
-
#
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) -
?Model -
#
getCustomFieldValueByName(string $customFieldName) -
?CustomFieldValue - Get the value for a custom field by the custom field name
-
#
getCustomFieldContent(string $customFieldName) -
?Content - Get the content for the custom field identified by the specified name
-
#
getCustomFieldContentOrDefault(string $customFieldName) -
?Content - Get the (default) content for the custom field identified by the specified name
-
#
getCustomFieldBoolean(string $customFieldName, ?bool $default) -
?bool - Get the (default) content of the custom field as boolean value
-
#
getCustomFieldText(string $customFieldName, ?string $default) -
?string - Get the (default) content of the custom field as text
-
#
getCustomFieldImage(string $customFieldName) -
?Image - Get the (default) image contained in the custom field
-
#
getCustomFieldFile(string $customFieldName) -
?File - Get the (default) file contained in the custom field
-
#
hasCustomField(string $customFieldName) -
bool - Check if the entity has a custom field with the specified name
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 27
Read-only values on the record.
-
#
fileInput -
bool - Returns whether form has InputFile at any step. This method can be used to decide whether to add
enctype="multipart/form-data"to form. -
#
steps -
?Collection - Get the steps for the active revision of the form. Returns null if the form does not have an active revision.
-
#
elements -
?Collection - Get the elements for the active revision of the form. Returns null if the form does not have an active revision.
-
#
id -
?int -
#
name -
?string -
#
identifier -
?string -
#
published -
?DateTime -
#
activeRevision -
?FormRevision -
#
revisions -
?Collection<FormRevision> -
#
lastRevision -
?Model -
#
customFieldValues -
?Collection<FormCustomFieldValue> -
#
customFieldContent -
object - Get a serialized representation of the custom fields associated with the record
-
#
externalId -
?string -
#
pendingPaymentRedirectUrlAPI & Jobs only -
?string - Returns a redirect URL if payment processing requires a browser redirect.
-
#
pendingPaymentSdkConfigAPI & Jobs only -
?array - Returns SDK configuration when payment processing requires an in-page button (e.g. PayPal Donate SDK). Null when payment completed synchronously or via redirect.
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 37
Take no arguments.
-
#
hasFileInput() -
bool - Returns whether form has InputFile at any step. This method can be used to decide whether to add
enctype="multipart/form-data"to form. -
#
getSteps() -
?Collection - Get the steps for the active revision of the form. Returns null if the form does not have an active revision.
-
#
getElements() -
?Collection - Get the elements for the active revision of the form. Returns null if the form does not have an active revision.
-
#
getId() -
?int -
#
getName() -
?string -
#
getIdentifier() -
?string -
#
getPublished() -
?DateTime -
#
getActiveRevision() -
?FormRevision -
#
getRevisions() -
?Collection<FormRevision> -
#
getLastRevision() -
?Model -
#
getCustomFieldValues() -
?Collection<FormCustomFieldValue> -
#
getExternalId() -
?string -
#
isHierarchicalModel()Not in API & Jobs -
bool - Check whether a model is a hierarchical model, i.e. can have children
-
#
getUniqueInputElements()Admin only -
Collection - Returns unique by name input elements of this model. Returns all elements through all revisions.
-
#
getCheckPermissionsUrl()Admin only -
?string - Get the url for checking user permissions for this record.
-
#
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 16
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) -
?Model -
#
getCustomFieldValueByName(string $customFieldName) -
?CustomFieldValue - Get the value for a custom field by the custom field name
-
#
getCustomFieldContent(string $customFieldName) -
?Content - Get the content for the custom field identified by the specified name
-
#
getCustomFieldContentOrDefault(string $customFieldName) -
?Content - Get the (default) content for the custom field identified by the specified name
-
#
getCustomFieldBoolean(string $customFieldName, ?bool $default) -
?bool - Get the (default) content of the custom field as boolean value
-
#
getCustomFieldText(string $customFieldName, ?string $default) -
?string - Get the (default) content of the custom field as text
-
#
getCustomFieldImage(string $customFieldName) -
?Image - Get the (default) image contained in the custom field
-
#
getCustomFieldFile(string $customFieldName) -
?File - Get the (default) file contained in the custom field
-
#
hasCustomField(string $customFieldName) -
bool - Check if the entity has a custom field with the specified name
-
#
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.