PHP Class Frontend\Modules\Profiles\Engine\Model

Datei anzeigen Open project: forkcms/forkcms Class Usage Examples

Public Methods

Method 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 method

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

existsByEmail() public static method

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.
return boolean

existsDisplayName() public static method

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.
return boolean

get() public static method

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

getAvatar() public static method

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

getEncryptedString() public static method

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.
return string

getIdByEmail() public static method

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

getIdBySetting() public static method

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

getRandomString() public static method

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.
return string

getSetting() public static method

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

getSettings() public static method

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

getUrl() public static method

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.
return string

insert() public static method

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

parse() public static method

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

setSetting() public static method

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 method

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 method

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