ModelDiscounts module

CodeUrl

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

Take no arguments.

# getSlug()
string
Gets the slug as the discount code value
# getOriginalFullSlug()
string
Gets the original full slug as the discount code without any custom URLs applied
# getOriginalFullPath()
string
Gets the original path for the code URL without custom URLs applied
# getOriginalPath()
string
It's an alias and deprecated! Directly use getOriginalFullPath() instead.
# getFullSlug()
string
Gets the slug that addresses this record relative to its module — the portion of the URL that identifies the record itself, without the module path and without a leading slash. For a hierarchical record the slug includes the slugs of all of its ancestors joined with slashes. This is the effective slug: when a custom URL is set on the record, it _takes precedence and is returned_ here. The no-leading-slash shape describes the canonical value only. A custom URL is returned verbatim, and custom URLs are stored with a leading slash, so a record that has one returns /my-custom rather than my-custom; use getOriginalFullSlug() when you need the canonical shape unconditionally.
# getFullPath()
string
Gets the relative path that addresses this record within the site, including the module path and starting with a leading slash. This is the getFullSlug() value prefixed with the route under which the module is mounted. This is the effective path: when a custom URL is set on the record, it _takes precedence and is returned_ here. Returns an empty string when the record has no custom URL and getOriginalFullPath() cannot build one, so callers must treat an empty string as "no url" rather than as a path. Rendering it into markup or handing it to a cache or route helper would otherwise point the record at whatever the site serves at its root.
# getId()
?int
# getRedirectEntity()
?string
# getRedirectRecordId()
?int
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getCode()
?Code
# getSite()
?Site
Gets the site of the record
# getCodeUrlProducts()
?Collection<CodeUrlProduct>
# getCustomUrl()
?CustomUrl
Get the custom url used for the page. This will take precedence over the slugs of this page, parent page and the module.
# 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 15

Read-only values on the record.

# slug
string
Gets the slug as the discount code value
# originalFullSlug
string
Gets the original full slug as the discount code without any custom URLs applied
# originalFullPath
string
Gets the original path for the code URL without custom URLs applied
# originalPath
string
It's an alias and deprecated! Directly use getOriginalFullPath() instead.
# fullSlug
string
Gets the slug that addresses this record relative to its module — the portion of the URL that identifies the record itself, without the module path and without a leading slash. For a hierarchical record the slug includes the slugs of all of its ancestors joined with slashes. This is the effective slug: when a custom URL is set on the record, it _takes precedence and is returned_ here. The no-leading-slash shape describes the canonical value only. A custom URL is returned verbatim, and custom URLs are stored with a leading slash, so a record that has one returns /my-custom rather than my-custom; use getOriginalFullSlug() when you need the canonical shape unconditionally.
# fullPath
string
Gets the relative path that addresses this record within the site, including the module path and starting with a leading slash. This is the getFullSlug() value prefixed with the route under which the module is mounted. This is the effective path: when a custom URL is set on the record, it _takes precedence and is returned_ here. Returns an empty string when the record has no custom URL and getOriginalFullPath() cannot build one, so callers must treat an empty string as "no url" rather than as a path. Rendering it into markup or handing it to a cache or route helper would otherwise point the record at whatever the site serves at its root.
# id
?int
# redirectEntity
?string
# redirectRecordId
?int
# created
?DateTime
Date the record was created.
# modified
?DateTime
Last modification date for the record.
# code
?Code
# site
?Site
Gets the site of the record
# codeUrlProducts
?Collection<CodeUrlProduct>
# customUrl
?CustomUrl
Get the custom url used for the page. This will take precedence over the slugs of this page, parent page and the module.

Admin view

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

Properties 18

Take no arguments.

# getSlug()
string
Gets the slug as the discount code value
# getOriginalFullSlug()
string
Gets the original full slug as the discount code without any custom URLs applied
# getOriginalFullPath()
string
Gets the original path for the code URL without custom URLs applied
# getOriginalPath()
string
It's an alias and deprecated! Directly use getOriginalFullPath() instead.
# getFullSlug()
string
Gets the slug that addresses this record relative to its module — the portion of the URL that identifies the record itself, without the module path and without a leading slash. For a hierarchical record the slug includes the slugs of all of its ancestors joined with slashes. This is the effective slug: when a custom URL is set on the record, it _takes precedence and is returned_ here. The no-leading-slash shape describes the canonical value only. A custom URL is returned verbatim, and custom URLs are stored with a leading slash, so a record that has one returns /my-custom rather than my-custom; use getOriginalFullSlug() when you need the canonical shape unconditionally.
# getFullPath()
string
Gets the relative path that addresses this record within the site, including the module path and starting with a leading slash. This is the getFullSlug() value prefixed with the route under which the module is mounted. This is the effective path: when a custom URL is set on the record, it _takes precedence and is returned_ here. Returns an empty string when the record has no custom URL and getOriginalFullPath() cannot build one, so callers must treat an empty string as "no url" rather than as a path. Rendering it into markup or handing it to a cache or route helper would otherwise point the record at whatever the site serves at its root.
# getId()
?int
# getRedirectEntity()
?string
# getRedirectRecordId()
?int
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getCode()
?Code
# getSite()
?Site
Gets the site of the record
# getCodeUrlProducts()
?Collection<CodeUrlProduct>
# getCustomUrl()
?CustomUrl
Get the custom url used for the page. This will take precedence over the slugs of this page, parent page and the module.
# 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