Documentation

pm_Client
in package

Panel client wrapper

Tags
since
11.0

Table of Contents

deleteSettings()  : mixed
Delete all custom client settings
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()  : string|null
Return value of custom client 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()  : mixed
Define value of custom client setting

Methods

deleteSettings()

Delete all custom client settings

public deleteSettings([string $prefix = '' ]) : mixed
Parameters
$prefix : string = ''

Settings name prefix

Tags
since
17.0
Return values
mixed

getAll()

Retrieve all clients

public static getAll() : array<string|int, pm_Client>
Tags
since
17.8.4
Return values
array<string|int, 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
throws
pm_Exception
Return values
pm_Client

getId()

Retrieve client id

public getId() : int
Return values
int

getLogin()

Retrieve login of client

public getLogin() : string
Tags
since
17.0
Return values
string

getProperty()

Retrieve property of client

public getProperty(string $name) : string
Parameters
$name : string
Return values
string

getSetting()

Return value of custom client setting by given name

public getSetting(string $name[, string $default = null ]) : string|null
Parameters
$name : string

Setting name

$default : string = null

Default value of setting

Tags
since
17.0
Return values
string|null

hasAccessToDomain()

Check if client can access to domain with provided identity

public hasAccessToDomain(int $domainId) : bool
Parameters
$domainId : int
Tags
since
12.0
Return values
bool

hasAccessToPlan()

Check if client can access to plan with provided identity

public hasAccessToPlan(int $planId) : bool
Parameters
$planId : int
Tags
since
17.5
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
since
17.5
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
since
17.0
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 custom client setting

public setSetting(string $name, string|null $value) : mixed
Parameters
$name : string

Setting name

$value : string|null

Setting value or null to delete setting

Tags
since
17.0
Return values
mixed

Search results