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

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

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

Метод Описание
deleteSetting ( integer $id, string $name ) : integer Delete a setting.
existsByEmail ( string $email, integer $ignoreId = null ) : boolean Check if a profile exists by email address.
existsDisplayName ( string $displayName, integer $id = null ) : boolean Check if a display name exists.
get ( integer $profileId ) : Profile Get profile by its id.
getAvatar ( integer $id, string $email = null, string $size = '240x240' ) : string Get avatar
getEncryptedString ( string $string, string $salt ) : string Get an encrypted string.
getIdByEmail ( string $email ) : integer Get profile id by email.
getIdBySetting ( string $name, string $value ) : integer Get profile id by setting.
getRandomString ( integer $length = 15, boolean $numeric = true, boolean $lowercase = true, boolean $uppercase = true, boolean $special = true ) : string Generate a random string.
getSetting ( integer $id, string $name ) : string Get a setting for a profile.
getSettings ( integer $id ) : array Get all settings for a profile.
getUrl ( string $displayName, integer $id = null ) : string Retrieve a unique URL for a profile based on the display name.
insert ( array $values ) : integer Insert a new profile.
parse ( ) Parse the general profiles info into the template.
setSetting ( integer $id, string $name, string $value ) Insert or update a single profile setting.
setSettings ( integer $id, array $values ) Insert or update multiple profile settings.
update ( integer $id, array $values ) : integer Update a profile.

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

deleteSetting() публичный статический Метод

Delete a setting.
public static deleteSetting ( integer $id, string $name ) : integer
$id integer Profile id.
$name string Setting name.
Результат integer

existsByEmail() публичный статический Метод

Check if a profile exists by email address.
public static existsByEmail ( string $email, integer $ignoreId = null ) : boolean
$email string Email to check for existence.
$ignoreId integer Profile id to ignore.
Результат boolean

existsDisplayName() публичный статический Метод

Check if a display name exists.
public static existsDisplayName ( string $displayName, integer $id = null ) : boolean
$displayName string Display name to check for existence.
$id integer Profile id to ignore.
Результат boolean

get() публичный статический Метод

Get profile by its id.
public static get ( integer $profileId ) : Profile
$profileId integer Id of the wanted profile.
Результат Profile

getAvatar() публичный статический Метод

Get avatar
public static getAvatar ( integer $id, string $email = null, string $size = '240x240' ) : string
$id integer The id for the profile we want to get the avatar from.
$email string The email from the user we can use for gravatar.
$size string The resolution you want to use. Default: 240x240 pixels.
Результат string $avatar The absolute path to the avatar.

getEncryptedString() публичный статический Метод

Get an encrypted string.
public static getEncryptedString ( string $string, string $salt ) : string
$string string String to encrypt.
$salt string Salt to add to the string.
Результат string

getIdByEmail() публичный статический Метод

Get profile id by email.
public static getIdByEmail ( string $email ) : integer
$email string Email address.
Результат integer

getIdBySetting() публичный статический Метод

Get profile id by setting.
public static getIdBySetting ( string $name, string $value ) : integer
$name string Setting name.
$value string Value of the setting.
Результат integer

getRandomString() публичный статический Метод

Generate a random string.
public static getRandomString ( integer $length = 15, boolean $numeric = true, boolean $lowercase = true, boolean $uppercase = true, boolean $special = true ) : string
$length integer Length of random string.
$numeric boolean Use numeric characters.
$lowercase boolean Use alphanumeric lowercase characters.
$uppercase boolean Use alphanumeric uppercase characters.
$special boolean Use special characters.
Результат string

getSetting() публичный статический Метод

Get a setting for a profile.
public static getSetting ( integer $id, string $name ) : string
$id integer Profile id.
$name string Setting name.
Результат string

getSettings() публичный статический Метод

Get all settings for a profile.
public static getSettings ( integer $id ) : array
$id integer Profile id.
Результат array

getUrl() публичный статический Метод

Retrieve a unique URL for a profile based on the display name.
public static getUrl ( string $displayName, integer $id = null ) : string
$displayName string The display name to base on.
$id integer The id of the profile to ignore.
Результат string

insert() публичный статический Метод

Insert a new profile.
public static insert ( array $values ) : integer
$values array Profile data.
Результат integer

parse() публичный статический Метод

Parse the general profiles info into the template.
public static parse ( )

setSetting() публичный статический Метод

Insert or update a single profile setting.
public static setSetting ( integer $id, string $name, string $value )
$id integer Profile id.
$name string Setting name.
$value string New setting value.

setSettings() публичный статический Метод

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

update() публичный статический Метод

Update a profile.
public static update ( integer $id, array $values ) : integer
$id integer The profile id.
$values array The values to update.
Результат integer