PHP Class Frontend\Modules\Profiles\Engine\Model

Afficher le fichier Open project: forkcms/forkcms Class Usage Examples

Méthodes publiques

Méthode Description
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.

Method Details

deleteSetting() public static méthode

Delete a setting.
public static deleteSetting ( integer $id, string $name ) : integer
$id integer Profile id.
$name string Setting name.
Résultat integer

existsByEmail() public static méthode

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.
Résultat boolean

existsDisplayName() public static méthode

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.
Résultat boolean

get() public static méthode

Get profile by its id.
public static get ( integer $profileId ) : Profile
$profileId integer Id of the wanted profile.
Résultat Profile

getAvatar() public static méthode

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.
Résultat string $avatar The absolute path to the avatar.

getEncryptedString() public static méthode

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.
Résultat string

getIdByEmail() public static méthode

Get profile id by email.
public static getIdByEmail ( string $email ) : integer
$email string Email address.
Résultat integer

getIdBySetting() public static méthode

Get profile id by setting.
public static getIdBySetting ( string $name, string $value ) : integer
$name string Setting name.
$value string Value of the setting.
Résultat integer

getRandomString() public static méthode

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.
Résultat string

getSetting() public static méthode

Get a setting for a profile.
public static getSetting ( integer $id, string $name ) : string
$id integer Profile id.
$name string Setting name.
Résultat string

getSettings() public static méthode

Get all settings for a profile.
public static getSettings ( integer $id ) : array
$id integer Profile id.
Résultat array

getUrl() public static méthode

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.
Résultat string

insert() public static méthode

Insert a new profile.
public static insert ( array $values ) : integer
$values array Profile data.
Résultat integer

parse() public static méthode

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

setSetting() public static méthode

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() public static méthode

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() public static méthode

Update a profile.
public static update ( integer $id, array $values ) : integer
$id integer The profile id.
$values array The values to update.
Résultat integer