pm_Client
in package
Panel client wrapper
Tags
Table of Contents
- deleteSettings() : void
- Delete all client custom settings
- getAdmin() : pm_Client
- Retrieve admin client.
- getAll() : array<string|int, pm_Client>
- Retrieve all clients
- getByClientId() : pm_Client
- Retrieve client by known id
- getByLogin() : pm_Client
- Retrieve client by known login. Throws pm_Exception if client not found.
- getId() : int
- Retrieve client id
- getLogin() : string
- Retrieve login of client
- getProperty() : string
- Retrieve property of client
- getSetting() : mixed
- Return value of client custom setting by given name
- hasAccessToDomain() : bool
- Check if client can access to domain with provided identity
- hasAccessToPlan() : bool
- Check if client can access to plan with provided identity
- hasCorePermission() : bool
- Check if user has core permission
- hasPermission() : bool
- Check if user has permission
- isAdmin() : bool
- Check if client is administrator
- isClient() : bool
- Check if client is simple client/customer
- isReseller() : bool
- Check if client is reseller
- setSetting() : void
- Define value of client custom setting
Methods
deleteSettings()
Delete all client custom settings
public
deleteSettings([string $prefix = '' ]) : void
Parameters
- $prefix : string = ''
-
Settings name prefix
Tags
Return values
void —getAdmin()
Retrieve admin client.
public
static getAdmin() : pm_Client
Tags
Return values
pm_Client —getAll()
Retrieve all clients
public
static getAll() : array<string|int, pm_Client>
Tags
Return values
array<string|int, pm_Client> —getByClientId()
Retrieve client by known id
public
static getByClientId(int $clientId) : pm_Client
Parameters
- $clientId : int
Tags
Return values
pm_Client —getByLogin()
Retrieve client by known login. Throws pm_Exception if client not found.
public
static getByLogin(string $login) : pm_Client
Parameters
- $login : string
Tags
Return values
pm_Client —getId()
Retrieve client id
public
getId() : int
Return values
int —getLogin()
Retrieve login of client
public
getLogin() : string
Tags
Return values
string —getProperty()
Retrieve property of client
public
getProperty(string $name) : string
Parameters
- $name : string
Return values
string —getSetting()
Return value of client custom setting by given name
public
getSetting(string $name[, mixed $default = null ]) : mixed
Parameters
- $name : string
-
Setting name
- $default : mixed = null
-
Default value of setting
Tags
Return values
mixed —hasAccessToDomain()
Check if client can access to domain with provided identity
public
hasAccessToDomain(int $domainId) : bool
Parameters
- $domainId : int
Tags
Return values
bool —hasAccessToPlan()
Check if client can access to plan with provided identity
public
hasAccessToPlan(int $planId) : bool
Parameters
- $planId : int
Tags
Return values
bool —hasCorePermission()
Check if user has core permission
public
hasCorePermission(string $name[, pm_Domain|null $domain = null ]) : bool
Parameters
- $name : string
-
Permission name
- $domain : pm_Domain|null = null
-
Domain to check permission (optional since 18.0)
Tags
Return values
bool —hasPermission()
Check if user has permission
public
hasPermission(string $name[, pm_Domain|null $domain = null ]) : bool
Parameters
- $name : string
-
Permission name
- $domain : pm_Domain|null = null
-
Domain to check permission (optional since 18.0)
Tags
Return values
bool —isAdmin()
Check if client is administrator
public
isAdmin() : bool
Return values
bool —isClient()
Check if client is simple client/customer
public
isClient() : bool
Return values
bool —isReseller()
Check if client is reseller
public
isReseller() : bool
Return values
bool —setSetting()
Define value of client custom setting
public
setSetting(string $name, mixed $value) : void
Parameters
- $name : string
-
Setting name
- $value : mixed
-
Setting value or null to delete setting