# Class Domain

The Domain class represents a single domain

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

  OpenCloud\Common\Base
  OpenCloud\Common\Resource\BaseResource
  OpenCloud\Common\Resource\PersistentResource
  OpenCloud\DNS\Resource\AbstractResource
  OpenCloud\DNS\Resource\Domain

#### Direct known subclasses

OpenCloud\DNS\Resource\Subdomain
Namespace: OpenCloud\DNS\Resource
Located at OpenCloud/DNS/Resource/Domain.php

Methods summary
`public `OpenCloud\DNS\Resource\Record`` | # `record( mixed $info = null )` returns a Record object returns a Record object Note that this method is available at the DNS level, but only for PTR records. #### Returns ``OpenCloud\DNS\Resource\Record``
`public OpenCloud\Collection` | # `recordList( array $filter = array() )` returns a Collection of Record objects returns a Collection of Record objects #### Parameters $filter `array` $filter query-string parameters #### Returns `OpenCloud\Collection`
`public` | # `subdomain( mixed $info = array() )` returns a Subdomain object (child of current domain) returns a Subdomain object (child of current domain)
`public` | # `subdomainList( array $filter = array() )` returns a Collection of subdomains returns a Collection of subdomains The subdomains are all `DNS:Domain` objects that are children of the current domain. #### Parameters $filter `array` $filter key/value pairs for query string parameters return \OpenCloud\Collection
`public integer` | # `addRecord( `OpenCloud\DNS\Resource\Record` $record )` Adds a new record to the list (for multiple record creation) Adds a new record to the list (for multiple record creation) #### Parameters $record ``OpenCloud\DNS\Resource\Record`` $rec the record to add #### Returns `integer` the number of records #### Api
`public integer` | # `addSubdomain( `OpenCloud\DNS\Resource\Subdomain` $subdomain )` adds a new subdomain (for multiple subdomain creation) adds a new subdomain (for multiple subdomain creation) #### Parameters $subdomain ``OpenCloud\DNS\Resource\Subdomain`` $subd the subdomain to add #### Returns `integer` the number of subdomains #### Api
`public DNS\Changes` | # `changes( string $since = null )` returns changes since a specified date/time returns changes since a specified date/time #### Parameters $since `string` $since the date or time #### Returns `DNS\Changes`
`public `OpenCloud\DNS\Resource\AsyncResponse`` | # `export( )` exports the domain exports the domain #### Returns ``OpenCloud\DNS\Resource\AsyncResponse``
`public `OpenCloud\DNS\Resource\AsyncResponse`` | # `cloneDomain( string $newDomainName, boolean $subdomains = true, boolean $comments = true, boolean $email = true, boolean $records = true )` clones the domain to the specified target domain clones the domain to the specified target domain #### Parameters $newDomainName `string` $newdomain the new domain to create from this domain $subdomains `boolean` $sub to clone subdomains as well $comments `boolean` $comments Replace occurrences of the reference domain name with the new domain name in comments $email `boolean` $email Replace occurrences of the reference domain name with the new domain name in email addresses on the cloned (new) domain. $records `boolean` $records 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. #### Returns ``OpenCloud\DNS\Resource\AsyncResponse``
`protected `stdClass`` | # `createJson( )` handles creation of multiple records at Create() handles creation of multiple records at Create() #### Returns ``stdClass`` #### Throws ``RuntimeException`` #### Overrides `OpenCloud\DNS\Resource\AbstractResource::createJson()`

Methods inherited from OpenCloud\DNS\Resource\AbstractResource
`create(), delete(), getCreateKeys(), getUpdateKeys(), update(), updateJson()`

Methods inherited from OpenCloud\Common\Resource\PersistentResource
`checkExtension(), getAlias(), noCreate(), noDelete(), noUpdate(), refresh(), refreshFromLocationUrl(), waitFor()`

Methods inherited from OpenCloud\Common\Resource\BaseResource
`__construct(), findLink(), getClient(), getMetadata(), getParent(), getService(), getUrl(), jsonCollectionElement(), jsonCollectionName(), jsonName(), parseResponse(), primaryKeyField(), resourceName(), setMetadata(), setParent(), setService()`

Methods inherited from OpenCloud\Common\Base
`__call(), checkJsonError(), generateUuid(), getInstance(), getJsonHeader(), getLogger(), getProperty(), makeResourceIteratorOptions(), populate(), propertyExists(), setLogger(), setProperty(), stripNamespace(), toCamel(), toUnderscores()`

Properties summary
`public mixed` | $id | `` | #
`public mixed` | $accountId | `` | #
`public mixed` | $ttl | `` | #
`public mixed` | $updated | `` | #
`public mixed` | $emailAddress | `` | #
`public mixed` | $created | `` | #
`public mixed` | $name | `` | #
`public mixed` | $comment | `` | #
`protected static boolean` | $json_name | `false` | #
`protected static string` | $json_collection_name | `'domains'` | #
`protected static string` | $url_resource | `'domains'` | #
`protected array` | $createKeys | `array( 'name', 'emailAddress', 'ttl', 'comment' )` | #
`protected array` | $updateKeys | `array( 'emailAddress', 'ttl', 'comment' )` | #

Properties inherited from OpenCloud\Common\Resource\BaseResource
`$metadata, $parent, $service`

Properties inherited from OpenCloud\Common\Base
`$aliases`