ModelUsers module

Person

A model in the Users module, with 36 members for templates, 29 API properties and 44 members for admin templates.

Users\Models\Frontend\Person Users\Models\Api\Person Users\Models\Backend\Person Also in Users: ApiKey Author AuthorCustomFieldValue Group GroupPrivilege LoginToken PersonAddress PersonAddressType PersonCustomFieldValue PrivilegeTarget Setting SettingValue User UserAcl UserCustomFieldValue UserPrivilege
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 27

Take no arguments.

# isRestricted()
bool
Indicates whether this person record is being returned in a restricted (PII-hidden) form. Always false for the regular Person response model; overridden to true in {@link \Ecommerce\Models\Response\RestrictedPerson}.
# getFullName()
string
Get the full name of the person
# getOrdersCount()
int
Get the number of orders for this person
# hasCart()
bool
Check whether this person has a cart
# getQuotesCount()
int
Get the number of quotes for this person
# getId()
?int
# getEmail()
?string
# getTitle()
?string
# getGender()
?string
# getFirstName()
?string
# getMiddleName()
?string
# getLastName()
?string
# getCreated()
?DateTime
Get the date the record was created.
# getModified()
?DateTime
Get the last modification date for the record.
# getUser()
?User
# getAuthor()
?Author
# getPersonAddresses()
?Collection<PersonAddress>
# getGroups()
?Collection<roup>
# getProductInterests()
?Collection<ProductInterest>
# getWishlist()
Collection<Wishlist>
# getTaxExemptionCode()
?string
# getCustomFieldValues()
?Collection<PersonCustomFieldValue>
# getCustomFields()
array
Get the custom fields for this entity
# getExternalId()
?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

Methods 9

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

# getCustomFieldValue(CustomField $customField)
?CustomFieldValue
Get the value for a custom field
# 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

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 29

Read-only values on the record.

# restricted
bool
Indicates whether this person record is being returned in a restricted (PII-hidden) form. Always false for the regular Person response model; overridden to true in {@link \Ecommerce\Models\Response\RestrictedPerson}.
# fullName
string
Get the full name of the person
# ordersCount
int
Get the number of orders for this person
# cart
bool
Check whether this person has a cart
# quotesCount
int
Get the number of quotes for this person
# deleteUrl Not in Templates
?string
Get the url for deleting the record.
# editUrl Not in Templates
?string
Get the url for editing the record.
# manageUrl Not in Templates
?string
Get the url for managing records.
# id
?int
# email
?string
# title
?string
# gender
?string
# firstName
?string
# middleName
?string
# lastName
?string
# created
?DateTime
Get the date the record was created.
# modified
?DateTime
Get the last modification date for the record.
# user
?User
# author
?Author
# personAddresses
?Collection<PersonAddress>
# groups
?Collection<roup>
# productInterests
?Collection<ProductInterest>
# wishlist
Collection<Wishlist>
# taxExemptionCode
?string
# customFieldValues
?Collection<PersonCustomFieldValue>
# customFieldContent
object
Get a serialized representation of the custom fields associated with the record
# customFields
array
Get the custom fields for this entity
# externalId
?string

Admin view

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

Properties 35

Take no arguments.

# isRestricted()
bool
Indicates whether this person record is being returned in a restricted (PII-hidden) form. Always false for the regular Person response model; overridden to true in {@link \Ecommerce\Models\Response\RestrictedPerson}.
# getFullName()
string
Get the full name of the person
# getOrdersCount()
int
Get the number of orders for this person
# hasCart()
bool
Check whether this person has a cart
# getQuotesCount()
int
Get the number of quotes for this person
# getDeleteUrl() Not in Templates
?string
Get the url for deleting the record.
# getEditUrl() Not in Templates
?string
Get the url for editing the record.
# getManageUrl() Not in Templates
?string
Get the url for managing records.
# getId()
?int
# getEmail()
?string
# getTitle()
?string
# getGender()
?string
# getFirstName()
?string
# getMiddleName()
?string
# getLastName()
?string
# getCreated()
?DateTime
Get the date the record was created.
# getModified()
?DateTime
Get the last modification date for the record.
# getUser()
?User
# getAuthor()
?Author
# getPersonAddresses()
?Collection<PersonAddress>
# getGroups()
?Collection<roup>
# getProductInterests()
?Collection<ProductInterest>
# getWishlist()
Collection<Wishlist>
# getTaxExemptionCode()
?string
# getCustomFieldValues()
?Collection<PersonCustomFieldValue>
# getCustomFields()
array
Get the custom fields for this entity
# getExternalId()
?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
# getAvailableGroups() Admin only
Collection
Get the available groups
# getNewAddress() Admin only
Address
Get a new address
# getDisplayProperty() Admin only
string
Get the display property to use
# getFullNameOrEmail() Admin only
string
Displays the user's full name or email in select fields (like Owner).

Methods 9

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

# getCustomFieldValue(CustomField $customField)
?CustomFieldValue
Get the value for a custom field
# 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