Documentation

Domain extends AbstractResource
in package

The Domain class represents a single domain

Note that the Subdomain class is defined in this same file because of mutual dependencies.

Table of Contents

PATCH_CONTENT_TYPE  = OpenCloudCommonConstantsMime::JSON_PATCH
$accountId  : mixed
$comment  : mixed
$created  : mixed
$emailAddress  : mixed
$id  : mixed
$name  : mixed
$ttl  : mixed
$updated  : mixed
$aliases  : array<string|int, mixed>
The aliases configure for the properties of the instance.
$createKeys  : mixed
$json_collection_name  : mixed
$json_name  : mixed
$metadata  : Metadata
$parent  : BaseResource
$service  : ServiceInterface
$updateKeys  : mixed
$url_resource  : mixed
$logger  : LoggerInterface
The logger instance
$properties  : array<string|int, mixed>
Holds all the properties added by overloading.
$records  : mixed
$subdomains  : mixed
__call()  : mixed
Intercept non-existent method calls for dynamic getter/setter functionality.
__construct()  : mixed
addRecord()  : int
Adds a new record to the list (for multiple record creation)
addSubdomain()  : int
adds a new subdomain (for multiple subdomain creation)
changes()  : Changes
returns changes since a specified date/time
checkExtension()  : bool
Check whether an extension is valid
checkJsonError()  : mixed
Checks the most recent JSON operation for errors.
cloneDomain()  : AsyncResponse
clones the domain to the specified target domain
create()  : Response
Create a new resource
createUrl()  : Url
delete()  : Response
Delete this resource
export()  : AsyncResponse
exports the domain
findLink()  : bool
Find a resource link based on a type
generateUuid()  : mixed
getClient()  : ClientInterface
Convenience method to return the service's client
getCreateKeys()  : array<string|int, mixed>|false
Retrieve the keys which are required when the object is created.
getInstance()  : static
getLogger()  : LoggerInterface
Returns the Logger object.
getMetadata()  : Metadata
getParent()  : mixed
getService()  : ServiceInterface
getUpdateKeys()  : array<string|int, mixed>|false
Retrieve the keys which are required when the object is updated.
getUrl()  : mixed
Get this resource's URL
hasLogger()  : bool
id()  : mixed
jsonCollectionElement()  : string
Returns the nested keys that could (rarely) prefix collection items. For example:
jsonCollectionName()  : string
Returns the top-level key for collection responses
jsonName()  : mixed
Returns the top-level key for the returned response JSON document
makeResourceIteratorOptions()  : mixed
name()  : string
parseResponse()  : mixed
Parse a HTTP response for the required content
populate()  : mixed
Populates the current object based on an unknown data type.
record()  : Record
returns a Record object
recordList()  : DnsIterator
returns a Collection of Record objects
refresh()  : Response
Refresh the state of a resource
refreshFromLocationUrl()  : mixed
Given a `location` URL, refresh this resource
region()  : mixed
resourceName()  : mixed
Returns the URI path for this resource
setLogger()  : $this
Sets the logger.
setMetadata()  : $this
setParent()  : self
setService()  : PersistentObject
status()  : string
stripNamespace()  : mixed
subdomain()  : mixed
returns a Subdomain object (child of current domain)
subdomainList()  : DnsIterator
returns a Collection of subdomains
toCamel()  : mixed
Convert a string to camelCase format.
toUnderscores()  : mixed
Convert string to underscore format.
update()  : Response
Update a resource
url()  : mixed
waitFor()  : mixed
A method to repeatedly poll the API resource, waiting for an eventual state change
createJson()  : stdClass
handles creation of multiple records at Create()
generateJsonPatch()  : string
Generates a JSON Patch representation and return its
getAlias()  : string
Returns the alias configured for the given key. If no alias exists it returns the original key.
getJsonHeader()  : mixed
getPatchHeaders()  : mixed
getProperty()  : mixed
Grab value out of the data array.
getUpdateablePropertiesAsArray()  : mixed
Returns the object's properties as an array
noCreate()  : mixed
noDelete()  : mixed
noUpdate()  : mixed
primaryKeyField()  : string
Returns the primary key field for the object
propertyExists()  : bool
Basic check to see whether property exists.
recursivelyAliasPropertyValue()  : mixed
Returns the given property value's alias, if configured; Else, the unchanged property value is returned. If the given property value is an array or an instance of \stdClass, it is aliases recursively.
refreshFromParent()  : mixed
Causes resource to refresh based on parent's URL
setProperty()  : mixed
We can set a property under three conditions:
updateJson()  : mixed
Provides JSON for update request body
checkAttributePrefix()  : bool
Checks the attribute $property and only permits it if the prefix is in the specified $prefixes array
getJson()  : stdClass
returns JSON based on $keys
isAccessible()  : bool
Does the property exist in the object variable list (i.e. does it have public or protected visibility?)

Constants

PATCH_CONTENT_TYPE

public mixed PATCH_CONTENT_TYPE = OpenCloudCommonConstantsMime::JSON_PATCH

Properties

$accountId

public mixed $accountId

$emailAddress

public mixed $emailAddress

$aliases

The aliases configure for the properties of the instance.

protected array<string|int, mixed> $aliases = array()

$createKeys

protected mixed $createKeys = array('name', 'emailAddress', 'ttl', 'comment')

$json_collection_name

protected static mixed $json_collection_name = 'domains'

$json_name

protected static mixed $json_name = false

$updateKeys

protected mixed $updateKeys = array('emailAddress', 'ttl', 'comment')

$url_resource

protected static mixed $url_resource = 'domains'

$properties

Holds all the properties added by overloading.

private array<string|int, mixed> $properties = array()

$records

private mixed $records = array()

$subdomains

private mixed $subdomains = array()

Methods

__call()

Intercept non-existent method calls for dynamic getter/setter functionality.

public __call( $method,  $args) : mixed
Parameters
$method :
$args :
Tags
throws
RuntimeException
Return values
mixed

addRecord()

Adds a new record to the list (for multiple record creation)

public addRecord(Record $record) : int
Parameters
$record : Record
Return values
int

the number of records

addSubdomain()

adds a new subdomain (for multiple subdomain creation)

public addSubdomain(Subdomain $subdomain) : int
Parameters
$subdomain : Subdomain
Return values
int

the number of subdomains

changes()

returns changes since a specified date/time

public changes([string $since = null ]) : Changes
Parameters
$since : string = null

the date or time

Return values
Changes

checkJsonError()

Checks the most recent JSON operation for errors.

public static checkJsonError() : mixed
Tags
throws
JsonError
codeCoverageIgnore
Return values
mixed

cloneDomain()

clones the domain to the specified target domain

public cloneDomain(mixed $newDomainName[, mixed $subdomains = true ][, bool $comments = true ][, bool $email = true ][, bool $records = true ]) : AsyncResponse
Parameters
$newDomainName : mixed
$subdomains : mixed = true
$comments : bool = true

Replace occurrences of the reference domain name with the new domain name in comments

$email : bool = true

Replace occurrences of the reference domain name with the new domain name in email addresses on the cloned (new) domain.

$records : bool = true

Replace occurrences of the reference domain name with the new domain name in data fields (of records) on the cloned (new) domain. Does not affect NS records.

Return values
AsyncResponse

create()

Create a new resource

public create([array<string|int, mixed> $params = array() ]) : Response
Parameters
$params : array<string|int, mixed> = array()
Return values
Response

Find a resource link based on a type

public findLink([string $type = 'self' ]) : bool
Parameters
$type : string = 'self'
Return values
bool

generateUuid()

public static generateUuid() : mixed
Return values
mixed

getCreateKeys()

Retrieve the keys which are required when the object is created.

public getCreateKeys() : array<string|int, mixed>|false
Return values
array<string|int, mixed>|false

getInstance()

public static getInstance() : static
Return values
static

getParent()

public getParent() : mixed
Return values
mixed

getUpdateKeys()

Retrieve the keys which are required when the object is updated.

public getUpdateKeys() : array<string|int, mixed>|false
Return values
array<string|int, mixed>|false

getUrl()

Get this resource's URL

public getUrl([null $path = null ][, array<string|int, mixed> $query = array() ]) : mixed
Parameters
$path : null = null

URI path to add on

$query : array<string|int, mixed> = array()

Query to add on

Return values
mixed

hasLogger()

public hasLogger() : bool
Return values
bool

jsonCollectionElement()

Returns the nested keys that could (rarely) prefix collection items. For example:

public static jsonCollectionElement() : string

{ "keypairs": [ { "keypair": { "fingerprint": "...", "name": "key1", "public_key": "..." } }, { "keypair": { "fingerprint": "...", "name": "key2", "public_key": "..." } } ] }

In the above example, "keypairs" would be the $json_collection_name and "keypair" would be the $json_collection_element

Return values
string

jsonCollectionName()

Returns the top-level key for collection responses

public static jsonCollectionName() : string
Return values
string

jsonName()

Returns the top-level key for the returned response JSON document

public static jsonName() : mixed
Tags
throws
DocumentError
Return values
mixed

makeResourceIteratorOptions()

public makeResourceIteratorOptions(mixed $resource) : mixed
Parameters
$resource : mixed
Return values
mixed

parseResponse()

Parse a HTTP response for the required content

public parseResponse(Response $response) : mixed
Parameters
$response : Response
Return values
mixed

populate()

Populates the current object based on an unknown data type.

public populate(mixed $info[, mixed $setObjects = true ]) : mixed
Parameters
$info : mixed
$setObjects : mixed = true
Tags
throws
InvalidArgumentError
Return values
mixed

record()

returns a Record object

public record([mixed $info = null ]) : Record

Note that this method is available at the DNS level, but only for PTR records.

Parameters
$info : mixed = null
Return values
Record

recordList()

returns a Collection of Record objects

public recordList([array<string|int, mixed> $filter = array() ]) : DnsIterator
Parameters
$filter : array<string|int, mixed> = array()

query-string parameters

Return values
DnsIterator

refreshFromLocationUrl()

Given a `location` URL, refresh this resource

public refreshFromLocationUrl( $url) : mixed
Parameters
$url :
Return values
mixed

resourceName()

Returns the URI path for this resource

public static resourceName() : mixed
Tags
throws
UrlError
Return values
mixed

setMetadata()

public setMetadata(mixed $data) : $this
Parameters
$data : mixed
Return values
$this

stripNamespace()

public stripNamespace(mixed $namespace) : mixed
Parameters
$namespace : mixed
Return values
mixed

subdomain()

returns a Subdomain object (child of current domain)

public subdomain([mixed $info = array() ]) : mixed
Parameters
$info : mixed = array()
Return values
mixed

subdomainList()

returns a Collection of subdomains

public subdomainList([array<string|int, mixed> $filter = array() ]) : DnsIterator

The subdomains are all DNS:Domain objects that are children of the current domain.

Parameters
$filter : array<string|int, mixed> = array()

key/value pairs for query string parameters return \OpenCloud\Collection

Return values
DnsIterator

toCamel()

Convert a string to camelCase format.

public toCamel( $string[, bool $capitalise = true ]) : mixed
Parameters
$string :
$capitalise : bool = true

Optional flag which allows for word capitalization.

Return values
mixed

toUnderscores()

Convert string to underscore format.

public toUnderscores( $string) : mixed
Parameters
$string :
Return values
mixed

update()

Update a resource

public update([array<string|int, mixed> $params = array() ]) : Response
Parameters
$params : array<string|int, mixed> = array()
Return values
Response

url()

public url([mixed $path = null ][, array<string|int, mixed> $query = array() ]) : mixed
Parameters
$path : mixed = null
$query : array<string|int, mixed> = array()
Tags
deprecated
Return values
mixed

waitFor()

A method to repeatedly poll the API resource, waiting for an eventual state change

public waitFor([null $state = null ][, null $timeout = null ][, null $callback = null ][, null $interval = null ]) : mixed
Parameters
$state : null = null

The expected state of the resource

$timeout : null = null

The maximum timeout to wait

$callback : null = null

The callback to use to check the state

$interval : null = null

How long between each refresh request

Return values
mixed

createJson()

handles creation of multiple records at Create()

protected createJson() : stdClass
Return values
stdClass

generateJsonPatch()

Generates a JSON Patch representation and return its

protected generateJsonPatch(mixed $updatedProperties) : string
Parameters
$updatedProperties : mixed

Properties of the resource to update

Return values
string

JSON Patch representation for updates

getAlias()

Returns the alias configured for the given key. If no alias exists it returns the original key.

protected getAlias(string $key) : string
Parameters
$key : string
Return values
string

getJsonHeader()

protected static getJsonHeader() : mixed
Return values
mixed

getPatchHeaders()

protected static getPatchHeaders() : mixed
Return values
mixed

getProperty()

Grab value out of the data array.

protected getProperty(string $property) : mixed
Parameters
$property : string
Return values
mixed

getUpdateablePropertiesAsArray()

Returns the object's properties as an array

protected getUpdateablePropertiesAsArray() : mixed
Return values
mixed

primaryKeyField()

Returns the primary key field for the object

protected primaryKeyField() : string
Return values
string

propertyExists()

Basic check to see whether property exists.

protected propertyExists(string $property[, bool $allowRetry = true ]) : bool
Parameters
$property : string

The property name being investigated.

$allowRetry : bool = true

If set to TRUE, the check will try to format the name in underscores because there are sometimes discrepancies between camelCaseNames and underscore_names.

Return values
bool

recursivelyAliasPropertyValue()

Returns the given property value's alias, if configured; Else, the unchanged property value is returned. If the given property value is an array or an instance of \stdClass, it is aliases recursively.

protected recursivelyAliasPropertyValue(mixed $propertyValue) : mixed
Parameters
$propertyValue : mixed

Array or \stdClass instance to alias

Return values
mixed

Property value, aliased recursively

refreshFromParent()

Causes resource to refresh based on parent's URL

protected refreshFromParent() : mixed
Return values
mixed

setProperty()

We can set a property under three conditions:

protected setProperty(mixed $property, mixed $value) : mixed
  1. If it has a concrete setter: setProperty()
  2. If the property exists
  3. If the property name's prefix is in an approved list
Parameters
$property : mixed
$value : mixed
Return values
mixed

updateJson()

Provides JSON for update request body

protected updateJson([mixed $params = array() ]) : mixed
Parameters
$params : mixed = array()
Return values
mixed

checkAttributePrefix()

Checks the attribute $property and only permits it if the prefix is in the specified $prefixes array

private checkAttributePrefix(string $property) : bool

This is to support extension namespaces in some services.

Parameters
$property : string

the name of the attribute

Return values
bool

getJson()

returns JSON based on $keys

private getJson(array<string|int, mixed> $keys) : stdClass
Parameters
$keys : array<string|int, mixed>

list of items to include

Return values
stdClass

isAccessible()

Does the property exist in the object variable list (i.e. does it have public or protected visibility?)

private isAccessible( $property) : bool
Parameters
$property :
Return values
bool

Search results