\pm_Client

Panel client wrapper

Summary

Methods
Properties
Constants
getByClientId()
getByLogin()
isAdmin()
isReseller()
isClient()
getId()
getLogin()
getProperty()
getSetting()
setSetting()
deleteSettings()
hasAccessToDomain()
hasPermission()
hasCorePermission()
hasAccessToPlan()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A

Properties

Methods

getByClientId()

getByClientId(integer  $clientId) : \pm_Client

Retrieve client by known id

Parameters

integer $clientId

Throws

\pm_Exception

Returns

\pm_Client

getByLogin()

getByLogin(string  $login) : \pm_Client

Retrieve client by known login

Parameters

string $login

Throws

\pm_Exception

Returns

\pm_Client

isAdmin()

isAdmin() : boolean

Check if client is administrator

Returns

boolean

isReseller()

isReseller() : boolean

Check if client is reseller

Returns

boolean

isClient()

isClient() : boolean

Check if client is simple client/customer

Returns

boolean

getId()

getId() : integer

Retrieve client id

Returns

integer

getLogin()

getLogin() : string

Retrieve login of client

Returns

string

getProperty()

getProperty(string  $name) : string

Retrieve property of client

Parameters

string $name

Returns

string

getSetting()

getSetting(string  $name, string  $default = null) : string|null

Return value of custom client setting by given name

Parameters

string $name

Setting name

string $default

Default value of setting

Returns

string|null

setSetting()

setSetting(string  $name, string|null  $value) 

Define value of custom client setting

Parameters

string $name

Setting name

string|null $value

Setting value or null to delete setting

deleteSettings()

deleteSettings(string  $prefix = '') 

Delete all custom client settings

Parameters

string $prefix

Settings name prefix

hasAccessToDomain()

hasAccessToDomain(integer  $domainId) : boolean

Check if client can access to domain with provided identity

Parameters

integer $domainId

Returns

boolean

hasPermission()

hasPermission(string  $name, \pm_Domain  $domain) : boolean

Check if user has permission for domain

Parameters

string $name

Permission name

\pm_Domain $domain

Domain to check permission

Returns

boolean

hasCorePermission()

hasCorePermission(string  $name, \pm_Domain  $domain) : boolean

Check if user has core permission for domain

Parameters

string $name

Permission name

\pm_Domain $domain

Domain to check permission

Returns

boolean

hasAccessToPlan()

hasAccessToPlan(integer  $planId) : boolean

Check if client can access to plan with provided identity

Parameters

integer $planId

Returns

boolean