ModelDiscounts module

Code

A model in the Discounts module, with 10 members for templates, 10 API properties and 13 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 10

Take no arguments.

# getCodeUrl()
CodeUrl
Gets code URL for the code: if not exist, creates a new model
# getId()
?int
# getCode()
?string
# getMaxUses()
?int
Gets maximum usage of the code: there is no limit when not set, but when it is 0, the code can't be used
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getDiscount()
?Discount
# 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 10

Read-only values on the record.

# codeUrl
CodeUrl
Gets code URL for the code: if not exist, creates a new model
# editUrl Not in Templates
?string
Get the url for editing the record.
# deleteUrl Not in Templates
?string
Get the url for deleting the record.
# id
?int
# code
?string
# maxUses
?int
Gets maximum usage of the code: there is no limit when not set, but when it is 0, the code can't be used
# created
?DateTime
Date the record was created.
# modified
?DateTime
Last modification date for the record.
# discount
?Discount

Admin view

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

Properties 13

Take no arguments.

# getCodeUrl()
CodeUrl
Gets code URL for the code: if not exist, creates a new model
# getEditUrl() Not in Templates
?string
Get the url for editing the record.
# getDeleteUrl() Not in Templates
?string
Get the url for deleting the record.
# getId()
?int
# getCode()
?string
# getMaxUses()
?int
Gets maximum usage of the code: there is no limit when not set, but when it is 0, the code can't be used
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getDiscount()
?Discount
# 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