Skip to content
Last updated

WHMCS\Domain\Registrar\Domain

Class

Store information regarding the domain that can be used within the product without requiring additional Registrar calls. Where a get method returns null, no value has been set for the requested variable and the result should not be used.

Constants

NameDescription
STATUS_ACTIVEDomain Status Constants
STATUS_ARCHIVED
STATUS_DELETED
STATUS_EXPIRED
STATUS_INACTIVE
STATUS_SUSPENDED
STATUS_PENDING_DELETE

Methods

getRegistrantEmailAddress

public function getRegistrantEmailAddress()

Retrieve the stored value for the registrant email address.

Returns null\|string

setRegistrantEmailAddress

public function setRegistrantEmailAddress($registrantEmailAddress)

Set the registrant email address for the domain.

Parameters

TypeNameDescription
null|string$registrantEmailAddress

Returns self

getDomain

public function getDomain()

Get the stored value for the domain.

Returns string\|null

setDomain

public function setDomain($domain)

Set the domain name.

Parameters

TypeNameDescription
string$domain

Returns self

getExpiryDate

public function getExpiryDate()

Retrieve the expiry date of the domain

Returns Carbon\|null

setExpiryDate

public function setExpiryDate(Carbon $expiryDate = null)

Set the expiry date value of the domain using a carbon object.

Example: Carbon::createFromFormat('Y-m-d', '2022-12-12')

Parameters

TypeNameDescription
Carbon|null$expiryDate

Returns self

getRegistrationStatus

public function getRegistrationStatus()

Retrieve the stored registration status

Returns string\|null

setRegistrationStatus

public function setRegistrationStatus($registrationStatus)

Set the registration status of the domain using the status constants within this class:

STATUS_ACTIVE STATUS_ARCHIVED STATUS_DELETED STATUS_EXPIRED STATUS_INACTIVE STATUS_SUSPENDED STATUS_PENDING_DELETE

Parameters

TypeNameDescription
string$registrationStatus

Returns self

getRestorable

public function getRestorable()

Retrieve if the domain is restorable.

Returns boolean\|null

setRestorable

public function setRestorable($restorable)

Set if the domain is currently restorable if the expiry date has passed.

Parameters

TypeNameDescription
boolean$restorable

Returns self

getRenewBeforeExpiration

public function getRenewBeforeExpiration()

Check if the domain can be renewed before expiry

Returns boolean\|null

setRenewBeforeExpiration

public function setRenewBeforeExpiration($renewBeforeExpiration)

Set if the domain can be renewed before the expiry date.

Parameters

TypeNameDescription
boolean$renewBeforeExpiration

Returns self

getIdProtectionStatus

public function getIdProtectionStatus()

Get if the domain currently has an active ID Protection product on it.

Returns boolean\|null

setIdProtectionStatus

public function setIdProtectionStatus($idProtectionStatus)

Set if the domain currently has an active ID Protection poduct on it.

Parameters

TypeNameDescription
boolean$idProtectionStatus

Returns self

getDnsManagementStatus

public function getDnsManagementStatus()

Get if DNS Management (A, AAAA, CNAME, etc., records) is active on this domain at the registrar.

Returns boolean

setDnsManagementStatus

public function setDnsManagementStatus($dnsManagementStatus)

Set if DNS Management (A, AAAA, CNAME, etc., records) is active on this domain at the registrar.

Parameters

TypeNameDescription
boolean$dnsManagementStatus

Returns self

getEmailForwardingStatus

public function getEmailForwardingStatus()

Check if email forwarding is enabled on the domain at the registrar

Returns boolean

setEmailForwardingStatus

public function setEmailForwardingStatus($emailForwardingStatus)

Set if email forwarding is enabled on the domain at the registrar.

Parameters

TypeNameDescription
boolean$emailForwardingStatus

Returns self

hasNameservers

public function hasNameservers()

Checks if the domain has more than zero nameservers associated with it that have been added using setNameservers

Returns boolean

getNameservers

public function getNameservers()

Retrieve the array of nameservers associated with the domain.

Returns array

setNameservers

public function setNameservers($nameservers)

Set the currently active nameservers for the domain.

Example: array('ns1' => 'ns1.example.com', 'ns2' => 'ns2.example.com', 'ns3' => 'ns3.example.com')

Parameters

TypeNameDescription
array$nameservers

Returns self

hasTransferLock

public function hasTransferLock()

Check if the transfer lock state has been set on the domain.

Returns boolean

getTransferLock

public function getTransferLock()

Check if the transfer lock is enabled on the domain.

Returns boolean\|null

setTransferLock

public function setTransferLock($transferLock)

Set the transfer lock status on the domain. True for enabled, false for disabled.

Parameters

TypeNameDescription
boolean$transferLock

Returns self

getTransferLockExpiryDate

public function getTransferLockExpiryDate()

Get the expiry date of the transfer lock.

Returns Carbon\|null

setTransferLockExpiryDate

public function setTransferLockExpiryDate(Carbon $transferLockExpiryDate = null)

Set the expiry date of the transfer lock using a Carbon object.

Example: Carbon::createFromFormat('Y-m-d', '2018-12-12')

Parameters

TypeNameDescription
Carbon$transferLockExpiryDate

Returns self

getIrtpOptOutStatus

public function getIrtpOptOutStatus()

Get if IRTP has been opted out.

Returns boolean\|null

setIrtpOptOutStatus

public function setIrtpOptOutStatus($irtpOptOutStatus)

Set if IRTP has been opted out of.

Parameters

TypeNameDescription
boolean$irtpOptOutStatus

Returns self

getIrtpTransferLock

public function getIrtpTransferLock()

Get the status of the irtp transfer lock.

Returns boolean\|null

setIrtpTransferLock

public function setIrtpTransferLock($irtpTransferLock)

Set the state of the irtp transfer lock.

Parameters

TypeNameDescription
boolean$irtpTransferLock

Returns self

getIrtpTransferLockExpiryDate

public function getIrtpTransferLockExpiryDate()

Get the expiry date of the transfer lock.

Returns Carbon\|null

setIrtpTransferLockExpiryDate

public function setIrtpTransferLockExpiryDate(Carbon $irtpTransferLockExpiryDate)

Set the expiry date of the transfer lock using a Carbon object.

Example: Carbon::createFromFormat('Y-m-d', '2018-12-12')

Parameters

TypeNameDescription
Carbon$irtpTransferLockExpiryDate

Returns self

isContactChangePending

public function isContactChangePending()

Check if a contact change is pending on the domain.

Returns boolean\|null

setDomainContactChangePending

public function setDomainContactChangePending($domainContactChangePending)

Set if a contact change is pending on the domain.

Parameters

TypeNameDescription
boolean$domainContactChangePending

Returns self

getDomainContactChangeExpiryDate

public function getDomainContactChangeExpiryDate()

Get the date that the contact change is to be confirmed by.

Returns Carbon\|null

setDomainContactChangeExpiryDate

public function setDomainContactChangeExpiryDate(Carbon $domainContactChangeExpiryDate = null)

Set the confirmation deadline that the contact change is to be confirmed by using a Carbon object.

Example: Carbon::createFromFormat('Y-m-d', '2018-12-12')

Parameters

TypeNameDescription
Carbon$domainContactChangeExpiryDate

Returns self

getPendingSuspension

public function getPendingSuspension()

Check if the domain is pending suspension. A domain will be pending suspension if a new registration has occurred and the registrant contact has not been confirmed.

Returns boolean\|null

setPendingSuspension

public function setPendingSuspension($willDomainSuspend)

Set if the domain is pending suspension.

Parameters

TypeNameDescription
boolean$willDomainSuspend

Returns self

setIsIrtpEnabled

public function setIsIrtpEnabled($isIrtpEnabled)

Set if this domain is subject to IRTP policies.

Returns $this

getIsIrtpEnabled

public function getIsIrtpEnabled()

Check if this domain is an ICANN tld and subject to IRTP policies.

Alias of self::isIrtpEnabled

Returns bool\|null

isIrtpEnabled

public function isIrtpEnabled()

Check if this domain is an ICANN tld and subject to IRTP policies.

Returns bool\|null

setIrtpVerificationTriggerFields

public function setIrtpVerificationTriggerFields(array $fields = [])

Set the fields that trigger IRTP verification when changed.

Example: array('Registrant' => array('First Name', 'Last Name', 'Organisation Name', 'Email',))

Parameters

TypeNameDescription
array$fields

Returns $this

getIrtpVerificationTriggerFields

public function getIrtpVerificationTriggerFields()

Obtain the fields that trigger IRTP verification.

Returns array