PublicProfile
in package
IMPORTANT: public user profile, a read-only DTO, deliberately not `User`.
Filled exclusively from :Api:System:User:publicProfile
(UserPresenter::internalActionPublicProfile()), whose payload is
a positive allowlist. This class is the other half of the same lock: it has nowhere to store
password, salt, email, ip, phone, street, zip, regId, …, so it cannot leak
them even by mistake.
Why not hydrate into User: User has a getter for each of these fields and gets
defaults from its constructor (password = '', email = null, banned = false). Neither
the template nor code review could then tell "the user has no phone" from "the phone was
deliberately not transferred", and a future {$profile->getEmail()} would silently print
nothing where data used to be. A separate type rules this out at compile time (the method
does not exist, so Latte fails immediately, not in production).
IMPORTANT: emailMasked / phoneMasked are finished display strings from the Api layer
(luk********@g****.com, +420*****21). Do not mask them again in the template or try to
unmask them: the raw value never reaches the front end.
Table of Contents
Properties
- $aboutMe : string|null
- $activated : bool
- $assetPath : string|null
- $banned : bool
- $city : string|null
- $country : string|null
- $emailMasked : string
- $firstname : string
- $hasPhone : bool
- $id : int|null
- $lastname : string
- $memberUntil : DateTimeImmutable|null
- $phoneMasked : string
- $ratingThreadId : int|null
- $registrationDatetime : DateTimeImmutable|null
- $url : string|null
- $username : string
Methods
- __construct() : mixed
- getAboutMe() : string|null
- getActivated() : bool
- getAssetPath() : string|null
- getBanned() : bool
- getCity() : string|null
- getCountry() : string|null
- getEmailMasked() : string
- Already masked e-mail from the Api layer; not masked again in the template.
- getFirstname() : string
- getId() : int|null
- getLastname() : string
- getMemberUntil() : DateTimeImmutable|null
- getPhoneMasked() : string
- Already masked phone from the Api layer; not masked again in the template.
- getRatingThreadId() : int|null
- getRegistrationDatetime() : DateTimeImmutable|null
- getUrl() : string|null
- getUsername() : string
- hasPhone() : bool
Properties
$aboutMe read-only
private
string|null
$aboutMe
$activated read-only
private
bool
$activated
$assetPath read-only
private
string|null
$assetPath
$banned read-only
private
bool
$banned
$city read-only
private
string|null
$city
$country read-only
private
string|null
$country
$emailMasked read-only
private
string
$emailMasked
$firstname read-only
private
string
$firstname
$hasPhone read-only
private
bool
$hasPhone
$id read-only
private
int|null
$id
$lastname read-only
private
string
$lastname
$memberUntil read-only
private
DateTimeImmutable|null
$memberUntil
$phoneMasked read-only
private
string
$phoneMasked
$ratingThreadId read-only
private
int|null
$ratingThreadId
$registrationDatetime read-only
private
DateTimeImmutable|null
$registrationDatetime
$url read-only
private
string|null
$url
$username read-only
private
string
$username
Methods
__construct()
public
__construct(int|null $id, string $username, string $firstname, string $lastname, string|null $assetPath, string|null $city, string|null $country, string|null $url, string|null $aboutMe, DateTimeImmutable|null $registrationDatetime, DateTimeImmutable|null $memberUntil, bool $activated, bool $banned, int|null $ratingThreadId, string $emailMasked, string $phoneMasked, bool $hasPhone) : mixed
Parameters
- $id : int|null
-
cms_system_users.user_id - $username : string
-
nickname (public name in reviews)
- $firstname : string
-
first name
- $lastname : string
-
last name
- $assetPath : string|null
-
relative path to the avatar (URL), not a disk path
- $city : string|null
-
coarse location without street/postcode/region
- $country : string|null
-
coarse location
- $url : string|null
-
website link entered by the user
- $aboutMe : string|null
-
"about me" text the user writes for the public
- $registrationDatetime : DateTimeImmutable|null
-
registration date (account age)
- $memberUntil : DateTimeImmutable|null
-
membership validity ("premium" badge)
- $activated : bool
-
badge
- $banned : bool
-
badge
- $ratingThreadId : int|null
-
rating thread = public aggregate
- $emailMasked : string
-
already masked e-mail, never raw
- $phoneMasked : string
-
already masked phone, never raw
- $hasPhone : bool
-
whether the user has a phone at all (controls the row display)
getAboutMe()
public
getAboutMe() : string|null
Return values
string|nullgetActivated()
public
getActivated() : bool
Return values
boolgetAssetPath()
public
getAssetPath() : string|null
Return values
string|nullgetBanned()
public
getBanned() : bool
Return values
boolgetCity()
public
getCity() : string|null
Return values
string|nullgetCountry()
public
getCountry() : string|null
Return values
string|nullgetEmailMasked()
Already masked e-mail from the Api layer; not masked again in the template.
public
getEmailMasked() : string
Return values
stringgetFirstname()
public
getFirstname() : string
Return values
stringgetId()
public
getId() : int|null
Return values
int|nullgetLastname()
public
getLastname() : string
Return values
stringgetMemberUntil()
public
getMemberUntil() : DateTimeImmutable|null
Return values
DateTimeImmutable|nullgetPhoneMasked()
Already masked phone from the Api layer; not masked again in the template.
public
getPhoneMasked() : string
Return values
stringgetRatingThreadId()
public
getRatingThreadId() : int|null
Return values
int|nullgetRegistrationDatetime()
public
getRegistrationDatetime() : DateTimeImmutable|null
Return values
DateTimeImmutable|nullgetUrl()
public
getUrl() : string|null
Return values
string|nullgetUsername()
public
getUsername() : string
Return values
stringhasPhone()
public
hasPhone() : bool