Skip to content
Last updated

WHMCS\Domains\DomainLookup\SearchResult

Class · extends Domain

Search results from a domain lookup query

Contains the data of a domain and information about it potential availability Also can potentially get a list of like-domain suggests

Constants

NameDescription
STATUS_REGISTERED
STATUS_NOT_REGISTERED
STATUS_RESERVED
STATUS_UNKNOWN
STATUS_TLD_NOT_SUPPORTED

Methods

__construct

public function __construct($sld, $tld)

Construct an object which will express the response of a domain lookup

Parameters

TypeNameDescription
string$sld
string$tld

factoryFromDomain

public static function factoryFromDomain(Domain $domain)

Factory a SearchResult from a regular domain instance

Parameters

TypeNameDescription
Domain$domain

Returns SearchResult

setScore

public function setScore($score)

Set the "score" of this domain compared to the original search query

If the search query the same as what this instance is about, the "score" would be 1.0

Parameters

TypeNameDescription
float$score

Returns $this

getScore

public function getScore()

The "score" of this domain compared to the original search query

If this instance represents the exact search query, the "score" should be 1.0

Returns float

setPremiumCostPricing

public function setPremiumCostPricing($pricing = [])

Set Premium Cost Pricing.

Parameters

TypeNameDescription
array$pricing

getPremiumCostPricing

public function getPremiumCostPricing()

Get Premium Cost Pricing.

Returns array

isAvailableForPurchase

public function isAvailableForPurchase()

Whether the domain is generally available for purchase

Returns bool

isMatchingLengthRequirements

public function isMatchingLengthRequirements()

Checks whether the domain matches length requirements

Returns bool

setStatus

public function setStatus($status)

Set availability status

There are several status, each a constant of this class. It is up to the provider that is manifesting this object to choose the correct one; it is up to the caller that is using this object to interpret that status.

Parameters

TypeNameDescription
string$status

Returns $this

getStatus

public function getStatus()

Get availability status

There are several status, each a constant of this class. It is up to the provider that is manifesting this object to choose the correct one; it is up to the caller that is using this object to interpret that status.

Returns string

getLegacyStatus

public function getLegacyStatus()

Determine legacy status value (pre WHMCS 6.0 logic)

Returns string

toArray

public function toArray()

Returns array

validateDomainName

public function validateDomainName(): ?string

Returns string — Return validation error message. If domain is valid return null

pricing

public function pricing()