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.

View source (opens new window)

# Public Properties

# firstName

Type
string (opens new window), null (opens new window)
Default value
null

First name

View source (opens new window)

# fullName

Type
string (opens new window), null (opens new window)
Default value
null
Since
4.0.0

Full name

View source (opens new window)

# lastName

Type
string (opens new window), null (opens new window)
Default value
null

Last name

View source (opens new window)

# 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.

View source (opens new window)

# prepareNamesForSave()

Parses fullName if set, or sets it based on firstName and lastName.

View source (opens new window)