PHP Класс Scalr\Model\Entity\Account\User

С версии: 5.4.0 (21.02.2015)
Автор: Vitaliy Demidov ([email protected])
Наследование: extends Scalr\Model\AbstractEntity
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$accountId integer Identifier of the account which User corresponds to
$comments string The comments
$created DateTime The timestamp when the record is created
$email string The email address of the user
$fullName string The full name of the User
$id integer The identifier of the User
$lastLogin DateTime The last timemestamp when the User signed in
$loginAttempts integer The number of failed sign-in attempts
$password string The password
$status string The status of the User
$type string The type

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

Метод Описание
__construct ( ) Constructor
applyLdapGroups ( $groups ) Special method for LDAP auth sync LDAP groups to Scalr groups
canEditUser ( User $user ) : boolean Checks whether the user is allowed to edit specified user
canManageAcl ( ) : boolean Checks whether the user is allowed to manage ACL
canRemoveUser ( User $user ) : boolean Checks whether the user is allowed to remove specified user
fetchSettings ( ) : array Fetches all settings from the database
getAccount ( ) : Client Gets account entity
getAccountId ( ) : integer Gets Identifier of the Account
getAclRoles ( boolean $ignoreCache = false ) : Scalr\Acl\Role\AccountRoleSuperposition Gets account level roles
getAclRolesByEnvironment ( integer $envId, boolean $ignoreCache = false ) : Scalr\Acl\Role\AccountRoleSuperposition Gets roles by specified identifier of the Environment
getEmail ( ) : string Gets email address of the User
getEnvironments ( string $filter = null ) : array Gets environments of the current user filtered by name
getId ( ) : integer Gets Identifier of the User
getLdapUsername ( ) : string Gets LDAP username of the User
getSetting ( string $name, boolean $useCache = true ) : string | null Gets specified setting
getTeams ( ) : array Gets user teams
hasAccessToEnvironment ( integer $envId ) : boolean Checks whether this user has access to the specified environment
inTeam ( integer $teamId ) : boolean Check if user is included in team
isAccountAdmin ( ) : boolean Checks if the user is account admin
isAccountOwner ( ) : boolean Checks if the user is account owher
isAccountSuperAdmin ( ) : boolean Checks if the user is account admin
isAdmin ( ) : boolean Checks if the user is admin user (scalr, financial). It means user doesn't have current environment
isFinAdmin ( ) : boolean Checks if the user is Financial admin
isScalrAdmin ( ) : boolean Checks if the user is Scalr admin
isTeamUser ( ) : boolean Checks if the user is team user
isUser ( ) : boolean Checks if the user is account user (owner, admin, team user)
saveSetting ( string $name, string $value ) : User Saves the value of the specified setting to the database
setSetting ( string $name, string $value ) : User Sets the value of the specified setting

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

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

Constructor
public __construct ( )

applyLdapGroups() публичный Метод

Special method for LDAP auth sync LDAP groups to Scalr groups
public applyLdapGroups ( $groups )
$groups

canEditUser() публичный Метод

Checks whether the user is allowed to edit specified user
public canEditUser ( User $user ) : boolean
$user User The user to edit
Результат boolean Returns true if the user is allowed to edit specified user

canManageAcl() публичный Метод

Checks whether the user is allowed to manage ACL
public canManageAcl ( ) : boolean
Результат boolean Returns true if user is allowed to manage ACL

canRemoveUser() публичный Метод

Checks whether the user is allowed to remove specified user
public canRemoveUser ( User $user ) : boolean
$user User The user to remove
Результат boolean Returns true if the user is allowed to remove specified user

fetchSettings() публичный Метод

Fetches all settings from the database
public fetchSettings ( ) : array
Результат array Returns all settings

getAccount() публичный Метод

Gets account entity
public getAccount ( ) : Client
Результат Scalr\Model\Entity\Client

getAccountId() публичный Метод

Gets Identifier of the Account
public getAccountId ( ) : integer
Результат integer Returns identifier of the Account

getAclRoles() публичный Метод

Gets account level roles
public getAclRoles ( boolean $ignoreCache = false ) : Scalr\Acl\Role\AccountRoleSuperposition
$ignoreCache boolean Whether it shoud ignore cache
Результат Scalr\Acl\Role\AccountRoleSuperposition Returns the list of the roles of account level

getAclRolesByEnvironment() публичный Метод

Gets roles by specified identifier of the Environment
public getAclRolesByEnvironment ( integer $envId, boolean $ignoreCache = false ) : Scalr\Acl\Role\AccountRoleSuperposition
$envId integer The identifier of the Environment
$ignoreCache boolean optional Whether it should ignore cache
Результат Scalr\Acl\Role\AccountRoleSuperposition Returns the list of the roles of account level by specified environment

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

Gets email address of the User
public getEmail ( ) : string
Результат string Returns user email address

getEnvironments() публичный Метод

Gets environments of the current user filtered by name
public getEnvironments ( string $filter = null ) : array
$filter string optional Filter string
Результат array

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

Gets Identifier of the User
public getId ( ) : integer
Результат integer Returns identifier of the User

getLdapUsername() публичный Метод

Gets LDAP username of the User
public getLdapUsername ( ) : string
Результат string Returns LDAP username

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

Gets specified setting
public getSetting ( string $name, boolean $useCache = true ) : string | null
$name string The name of the setting
$useCache boolean optional Whether it should use cache
Результат string | null Returns the value on success or NULL if it does not exist.

getTeams() публичный Метод

Gets user teams
public getTeams ( ) : array
Результат array

hasAccessToEnvironment() публичный Метод

Checks whether this user has access to the specified environment
public hasAccessToEnvironment ( integer $envId ) : boolean
$envId integer The identifier of the environment
Результат boolean Returns TRUE if the user has access to the specified environment

inTeam() публичный Метод

Check if user is included in team
public inTeam ( integer $teamId ) : boolean
$teamId integer
Результат boolean

isAccountAdmin() публичный Метод

Checks if the user is account admin
public isAccountAdmin ( ) : boolean
Результат boolean Returns true if user is account admin

isAccountOwner() публичный Метод

Checks if the user is account owher
public isAccountOwner ( ) : boolean
Результат boolean Returns true if user is account owner.

isAccountSuperAdmin() публичный Метод

Checks if the user is account admin
public isAccountSuperAdmin ( ) : boolean
Результат boolean Returns true if user is account super admin

isAdmin() публичный Метод

Checks if the user is admin user (scalr, financial). It means user doesn't have current environment
public isAdmin ( ) : boolean
Результат boolean

isFinAdmin() публичный Метод

Checks if the user is Financial admin
public isFinAdmin ( ) : boolean
Результат boolean Returns true if user is Financial Admin

isScalrAdmin() публичный Метод

Checks if the user is Scalr admin
public isScalrAdmin ( ) : boolean
Результат boolean Returns true if user is Scalr Admin

isTeamUser() публичный Метод

Checks if the user is team user
public isTeamUser ( ) : boolean
Результат boolean Returns true if user is team user

isUser() публичный Метод

Checks if the user is account user (owner, admin, team user)
public isUser ( ) : boolean
Результат boolean

saveSetting() публичный Метод

Saves the value of the specified setting to the database
public saveSetting ( string $name, string $value ) : User
$name string The name of the setting
$value string The value
Результат User

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

Sets the value of the specified setting
public setSetting ( string $name, string $value ) : User
$name string The name of the setting
$value string The value
Результат User

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

$accountId публичное свойство

Identifier of the account which User corresponds to
public int $accountId
Результат integer

$comments публичное свойство

The comments
public string $comments
Результат string

$created публичное свойство

The timestamp when the record is created
public DateTime $created
Результат DateTime

$email публичное свойство

The email address of the user
public string $email
Результат string

$fullName публичное свойство

The full name of the User
public string $fullName
Результат string

$id публичное свойство

The identifier of the User
public int $id
Результат integer

$lastLogin публичное свойство

The last timemestamp when the User signed in
public DateTime $lastLogin
Результат DateTime

$loginAttempts публичное свойство

The number of failed sign-in attempts
public int $loginAttempts
Результат integer

$password публичное свойство

The password
public string $password
Результат string

$status публичное свойство

The status of the User
public string $status
Результат string

$type публичное свойство

The type
public string $type
Результат string