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

Автор: Dieter Vanden Eynde ([email protected])
Автор: Jeroen Desloovere ([email protected])
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$avatars Cache avatars

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

Метод Описание
delete ( mixed $ids ) Delete the given profiles.
deleteGroup ( integer $id ) Delete a profile group.
deleteProfileGroup ( integer $id ) Delete a membership of a profile in a group.
deleteSession ( integer $id ) Delete a sessions of a profile.
exists ( integer $id ) : boolean Check if a profile exists.
existsByEmail ( string $email, integer $id = null ) : boolean Check if a profile exists by email address.
existsDisplayName ( string $displayName, integer $id = null ) : boolean Check if a display name exists.
existsGroup ( integer $id ) : boolean Check if a group exists.
existsGroupName ( string $groupName, integer $id = null ) : boolean Check if a group name exists.
existsProfileGroup ( integer $id ) : boolean Check if a profile is in a group.
get ( integer $id ) : array Get information about a profile.
getAvatar ( integer $id, string $email = null ) : string Get avatar
getByEmail ( string $email ) : array Get information about a profile, by email
getEncryptedString ( string $string, string $salt ) : string Encrypt a string with a salt.
getGroup ( integer $id ) : array Get information about a profile group.
getGroups ( ) : array Get the list of all groups as array($groupId => $groupName).
getGroupsForDropDown ( integer $profileId, integer $includeId = null ) : array Get profile groups for dropdown not yet linked to a profile
getProfileGroup ( integer $id ) : array Get information about a profile group where a user is member of.
getProfileGroups ( integer $id ) : array Get the groups where a profile is member of.
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.
getStatusForDropDown ( ) : array Fetch the list of status, but for a dropdown.
getUrl ( string $displayName, integer $id = null ) : string Retrieve a unique URL for a profile based on the display name.
getUser ( integer $id ) : string Get the HTML for a user to use in a datagrid
importCsv ( array $data, null $groupId = null, boolean $overwriteExisting = false ) : array Import CSV data
insert ( array $values ) : integer Insert a new profile.
insertGroup ( array $values ) : integer Insert a new group.
insertProfileGroup ( array $values ) : integer Add a profile to a group.
notifyAdmin ( array $values, string $templatePath = null ) Notify admin - after adding profile to profiles module
notifyProfile ( array $values, boolean $forUpdate = false, string $templatePath = null ) Notify profile - after adding profile to profiles module
setSetting ( integer $id, string $name, mixed $value ) Insert or update a single profile setting.
update ( integer $id, array $values ) : integer Update a profile.
updateGroup ( integer $id, array $values ) : integer Update a profile group.
updateProfileGroup ( integer $id, array $values ) : integer Update a membership of a profile in a group.

Защищенные методы

Метод Описание
sendMail ( string $subject, string $templatePath = null, array $variables, string $toEmail, string $toDisplayName = null ) Send mail

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

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

Delete the given profiles.
public static delete ( mixed $ids )
$ids mixed One ID, or an array of IDs.

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

Delete a profile group.
public static deleteGroup ( integer $id )
$id integer Id of the group.

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

Delete a membership of a profile in a group.
public static deleteProfileGroup ( integer $id )
$id integer Id of the membership.

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

Delete a sessions of a profile.
public static deleteSession ( integer $id )
$id integer Profile id.

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

Check if a profile exists.
public static exists ( integer $id ) : boolean
$id integer Profile id.
Результат boolean

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

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

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

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

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

Check if a group exists.
public static existsGroup ( integer $id ) : boolean
$id integer Group id.
Результат boolean

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

Check if a group name exists.
public static existsGroupName ( string $groupName, integer $id = null ) : boolean
$groupName string Group name.
$id integer Group id to ignore.
Результат boolean

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

Check if a profile is in a group.
public static existsProfileGroup ( integer $id ) : boolean
$id integer Membership id.
Результат boolean

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

Get information about a profile.
public static get ( integer $id ) : array
$id integer The profile id to get the information for.
Результат array

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

Get avatar
public static getAvatar ( integer $id, string $email = null ) : 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.
Результат string $avatar The absolute path to the avatar.

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

Get information about a profile, by email
public static getByEmail ( string $email ) : array
$email string The profile email to get the information for.
Результат array

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

Encrypt a string with a salt.
public static getEncryptedString ( string $string, string $salt ) : string
$string string String to encrypt.
$salt string Salt to saltivy the string with.
Результат string

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

Get information about a profile group.
public static getGroup ( integer $id ) : array
$id integer Id of the group.
Результат array

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

Get the list of all groups as array($groupId => $groupName).
public static getGroups ( ) : array
Результат array

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

Get profile groups for dropdown not yet linked to a profile
public static getGroupsForDropDown ( integer $profileId, integer $includeId = null ) : array
$profileId integer Profile id.
$includeId integer Group id to always include.
Результат array

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

Get information about a profile group where a user is member of.
public static getProfileGroup ( integer $id ) : array
$id integer Membership id.
Результат array

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

Get the groups where a profile is member of.
public static getProfileGroups ( integer $id ) : array
$id integer The profile id to get the groups for.
Результат array

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

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

Fetch the list of status, but for a dropdown.
public static getStatusForDropDown ( ) : array
Результат 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

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

Get the HTML for a user to use in a datagrid
public static getUser ( integer $id ) : string
$id integer The Id of the user.
Результат string

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

Import CSV data
public static importCsv ( array $data, null $groupId = null, boolean $overwriteExisting = false ) : array
$data array The array from the .csv file
$groupId null $groupId Adding these profiles to a group
$overwriteExisting boolean $overwriteExisting
Результат array array('count' => array('exists' => 0, 'inserted' => 0));

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

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

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

Insert a new group.
public static insertGroup ( array $values ) : integer
$values array Group data.
Результат integer

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

Add a profile to a group.
public static insertProfileGroup ( array $values ) : integer
$values array Membership data.
Результат integer

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

Notify admin - after adding profile to profiles module
public static notifyAdmin ( array $values, string $templatePath = null )
$values array
$templatePath string

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

Notify profile - after adding profile to profiles module
public static notifyProfile ( array $values, boolean $forUpdate = false, string $templatePath = null )
$values array
$forUpdate boolean
$templatePath string

sendMail() защищенный статический Метод

Send mail
protected static sendMail ( string $subject, string $templatePath = null, array $variables, string $toEmail, string $toDisplayName = null )
$subject string
$templatePath string
$variables array
$toEmail string
$toDisplayName string

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

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

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

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

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

Update a profile group.
public static updateGroup ( integer $id, array $values ) : integer
$id integer Group id.
$values array Group data.
Результат integer

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

Update a membership of a profile in a group.
public static updateProfileGroup ( integer $id, array $values ) : integer
$id integer Membership id.
$values array Membership data.
Результат integer

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

$avatars защищенное статическое свойство

Cache avatars
protected static $avatars