CoolCMS API

PublicProfile
in package

FinalYes

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

$memberUntil read-only

private DateTimeImmutable|null $memberUntil

$registrationDatetime read-only

private DateTimeImmutable|null $registrationDatetime

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|null

getActivated()

public getActivated() : bool
Return values
bool

getAssetPath()

public getAssetPath() : string|null
Return values
string|null

getCity()

public getCity() : string|null
Return values
string|null

getCountry()

public getCountry() : string|null
Return values
string|null

getEmailMasked()

Already masked e-mail from the Api layer; not masked again in the template.

public getEmailMasked() : string
Return values
string

getFirstname()

public getFirstname() : string
Return values
string

getLastname()

public getLastname() : string
Return values
string

getMemberUntil()

public getMemberUntil() : DateTimeImmutable|null
Return values
DateTimeImmutable|null

getPhoneMasked()

Already masked phone from the Api layer; not masked again in the template.

public getPhoneMasked() : string
Return values
string

getRatingThreadId()

public getRatingThreadId() : int|null
Return values
int|null

getRegistrationDatetime()

public getRegistrationDatetime() : DateTimeImmutable|null
Return values
DateTimeImmutable|null

getUrl()

public getUrl() : string|null
Return values
string|null

getUsername()

public getUsername() : string
Return values
string
On this page

Search results