NameTrait ​
- Type
- Trait
- Namespace
- craft\base
- Implemented by
- craft\elements\Address, craft\elements\User
- Since
- 4.0.0
NameTrait implements the common properties for entities with full/first/last names.
Public Properties ​
Property | Description |
---|---|
firstName | string, null – First name |
fullName | string, null – Full name |
lastName | string, null – Last name |
firstName
​
First name
fullName
​
Full name
lastName
​
Last name
Protected Methods ​
Method | Description |
---|---|
normalizeNames() | Normalizes the name properties. |
prepareNamesForSave() | Parses fullName if set, or sets it based on firstName and lastName . |
normalizeNames()
​
Normalizes the name properties.
prepareNamesForSave()
​
Parses fullName
if set, or sets it based on firstName
and lastName
.