Methods

__construct()

__construct(integer  $domainId) 

Create new domain wrapper

Parameters

integer $domainId

Throws

\pm_Exception

getByDomainId()

getByDomainId(integer  $domainId) : \pm_Domain

Retrieve domain by known id

Parameters

integer $domainId

Throws

\pm_Exception

Returns

\pm_Domain

getByGuid()

getByGuid(string  $domainGuid) : \pm_Domain

Retrieve domain by GUID

Parameters

string $domainGuid

Throws

\pm_Exception

Returns

\pm_Domain

getByName()

getByName(string  $domainName) : \pm_Domain

Retrieve domain by display name

Parameters

string $domainName

Throws

\pm_Exception

Returns

\pm_Domain

getAllDomains()

getAllDomains(boolean  $mainDomainsOnly = false) : array<mixed,\pm_Domain>

Retrieve all domains

Parameters

boolean $mainDomainsOnly

[optional] Return only main domains. Default is false.

Returns

array<mixed,\pm_Domain>

getDomainsByClient()

getDomainsByClient(\pm_Client  $client, boolean  $mainDomainsOnly = false) : array<mixed,\pm_Domain>

Retrieve all client domains

Parameters

\pm_Client $client

Domains owner

boolean $mainDomainsOnly

[optional] Return only main domains. Default is false.

Returns

array<mixed,\pm_Domain>

getId()

getId() : integer

Retrieve domain id

Returns

integer

getGuid()

getGuid() : string

Retrieve domain GUID

Returns

string

getName()

getName() : string

Retrieve domain name in ASCII format

Returns

string

getDisplayName()

getDisplayName() : string

Retrieve domain name to be displayed in UI

Returns

string

getIpAddresses()

getIpAddresses(boolean  $public = true) : array<mixed,string>

Retrieve domain IP addresses

Parameters

boolean $public

Return public IP addresses. For Plesk servers behind NAT private IP addresses are matched to corresponding public ones. Default is true.

Returns

array<mixed,string>

isActive()

isActive() : boolean

Check if domain is active

Returns

boolean

isSuspended()

isSuspended() : boolean

Check if domain is suspended

Returns

boolean

isDisabled()

isDisabled() : boolean

Check if domain is disabled

Returns

boolean

getClient()

getClient() : \pm_Client

Retrieve owner of domain

Returns

\pm_Client

getProperty()

getProperty(string  $name) : string

Retrieve property of domain

Parameters

string $name

Throws

\pm_Exception

Returns

string

getSetting()

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

Return value of custom domain 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 domain setting

Parameters

string $name

Setting name

string|null $value

Setting value or null to delete setting

deleteSettings()

deleteSettings(string  $prefix = '') 

Delete all custom domain settings

Parameters

string $prefix

Settings name prefix

hasPermission()

hasPermission(string  $name) : mixed

Retrieve permission value by name

Parameters

string $name

Permission name

Returns

mixed

hasCorePermission()

hasCorePermission(string  $name) : mixed

Retrieve Plesk core permission value by name

Parameters

string $name

Permission name

Returns

mixed

getLimit()

getLimit(string  $name) : mixed

Retrieve limit value by name

Parameters

string $name

Limit name

Returns

mixed

getCoreLimit()

getCoreLimit(string  $name) : mixed

Retrieve Plesk core limit value by name

Parameters

string $name

Limit name

Returns

mixed

hasHosting()

hasHosting() : boolean

Check if domain has web hosting configured

Returns

boolean

getHomePath()

getHomePath() : string

Retrieve domain home path

Returns

string

getSysUserLogin()

getSysUserLogin() : string

Retrieve domain system user login

Returns

string

getDocumentRoot()

getDocumentRoot(boolean  $relative = false) : string

Retrieve domain document root directory. Available for domains with web hosting

Parameters

boolean $relative

[optional] Return root directory relative to home path. Default is false.

Throws

\pm_Exception

Returns

string

getVhostSystemPath()

getVhostSystemPath() : string

Retrieve domain vhost system directory. Available for domains with web hosting

Throws

\pm_Exception

Returns

string

getPlanItems()

getPlanItems() : array<mixed,string>

Get included plan items

Returns

array<mixed,string>

getScreenshotUrl()

getScreenshotUrl(string  $path = '/', array  $options = array()) : string

Get URL to screenshot of specified path on domain

Available screenshot options:

[
    'type' => string, // Image type, can be either png or jpeg. Default: 'png'.
    'width' => int, // Browser window width, between 16-2048. Default: 1600.
    'height' => int, // Browser window height, between 16-2048. Default: 1200.
    'scale' => float, // Browser scale factor, between 0.01-1. Default: 1.
    'delay' => int, // Time in seconds, to delay the rendering of the snapshot, between 0-45. Default: 0.
    'cache' => int, // Time in seconds, after which the screenshot is considered obsolete and will be generated again. Default: 3600.
]

Parameters

string $path
array $options

Returns

string