PHP Класс Frontend\Modules\Profiles\Engine\Profile

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$groups array The groups this profile belongs to, if any. The keys are the group IDs, the values the HTML-escaped group names.

Открытые методы

Метод Описание
__construct ( integer $profileId = null ) Constructor.
getDisplayName ( ) : string Get display name.
getEmail ( ) : string Get email.
getId ( ) : integer Get profile id.
getRegisteredOn ( ) : integer Get registered on date.
getSetting ( string $name, string $defaultValue = null ) : mixed Get a profile setting by name.
getSettings ( ) : array Get all settings.
getStatus ( ) : string Get status.
getUrl ( ) : string Get profile url.
isInGroup ( integer $groupId ) : boolean Does this user belong to the group with the given ID?
loadProfileByUrl ( string $url ) Load a profile by URL
setDisplayName ( string $value ) Set a display name.
setEmail ( string $value ) Set a profile email.
setRegisteredOn ( integer $value ) Set a register date.
setSetting ( string $name, string $value ) Set a profile setting.
setSettings ( array $values ) Insert or update multiple profile settings.
setStatus ( string $value ) Set a profile status.
setUrl ( string $value ) Set a profile url.
toArray ( ) : array Convert the object into an array for usage in the template

Приватные методы

Метод Описание
loadProfile ( integer $id ) Load a user profile by id.
setId ( integer $value ) Set a profile id.

Описание методов

__construct() публичный метод

Constructor.
public __construct ( integer $profileId = null )
$profileId integer The profile id to load data from.

getDisplayName() публичный метод

Get display name.
public getDisplayName ( ) : string
Результат string

getEmail() публичный метод

Get email.
public getEmail ( ) : string
Результат string

getId() публичный метод

Get profile id.
public getId ( ) : integer
Результат integer

getRegisteredOn() публичный метод

Get registered on date.
public getRegisteredOn ( ) : integer
Результат integer

getSetting() публичный метод

Get a profile setting by name.
public getSetting ( string $name, string $defaultValue = null ) : mixed
$name string Setting name.
$defaultValue string Default value is used when the setting does not exist.
Результат mixed

getSettings() публичный метод

Get all settings.
public getSettings ( ) : array
Результат array

getStatus() публичный метод

Get status.
public getStatus ( ) : string
Результат string

getUrl() публичный метод

Get profile url.
public getUrl ( ) : string
Результат string

isInGroup() публичный метод

Does this user belong to the group with the given ID?
public isInGroup ( integer $groupId ) : boolean
$groupId integer Group id.
Результат boolean

loadProfileByUrl() публичный метод

Load a profile by URL
public loadProfileByUrl ( string $url )
$url string

setDisplayName() публичный метод

Set a display name.
public setDisplayName ( string $value )
$value string Display name value.

setEmail() публичный метод

Set a profile email.
public setEmail ( string $value )
$value string Email address.

setRegisteredOn() публичный метод

Set a register date.
public setRegisteredOn ( integer $value )
$value integer Register date timestamp.

setSetting() публичный метод

Set a profile setting.
public setSetting ( string $name, string $value )
$name string Setting name.
$value string New setting value.

setSettings() публичный метод

Insert or update multiple profile settings.
public setSettings ( array $values )
$values array Settings in key=>value form.

setStatus() публичный метод

Set a profile status.
public setStatus ( string $value )
$value string Status.

setUrl() публичный метод

Set a profile url.
public setUrl ( string $value )
$value string Url.

toArray() публичный метод

Convert the object into an array for usage in the template
public toArray ( ) : array
Результат array

Описание свойств

$groups защищенное свойство

The groups this profile belongs to, if any. The keys are the group IDs, the values the HTML-escaped group names.
protected array $groups
Результат array