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

class SearchResult extends Domain

Constants

STATUS_REGISTERED

STATUS_NOT_REGISTERED

STATUS_RESERVED

STATUS_UNKNOWN

STATUS_TLD_NOT_SUPPORTED

Properties summary

Type Property Description
protected $score
protected $premiumCostPricing
protected $status

Methods summary

Return Type Method Name Description
__construct(string $sld, string $tld) Construct an object which will express the response of a domain lookup
static SearchResult factoryFromDomain(Domain $domain) Factory a SearchResult from a regular domain instance
$this setScore(float $score) Set the "score" of this domain compared to the original search query
float getScore() The "score" of this domain compared to the original search query
setPremiumCostPricing(array $pricing = []) Set Premium Cost Pricing.
array getPremiumCostPricing() Get Premium Cost Pricing.
bool isAvailableForPurchase() Whether the domain is generally available for purchase
bool isMatchingLengthRequirements() Checks whether the domain matches length requirements
$this setStatus(string $status) Set availability status
string getStatus() Get availability status
string getLegacyStatus() Determine legacy status value (pre WHMCS 6.0 logic)
array toArray() -
pricing() -
DomainPricing calculatePremiumPricing() Calculate Premium Pricing with Markup.

Details

__construct (string $sld, string $tld)

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

Parameters

string $sld
string $tld

static SearchResult factoryFromDomain (Domain $domain)

Factory a SearchResult from a regular domain instance

Parameters

Domain $domain

Return Value

SearchResult

$this setScore (float $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

float $score

Return Value

$this

float 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

Return Value

float

setPremiumCostPricing (array $pricing = [])

Set Premium Cost Pricing.

Parameters

array $pricing

array getPremiumCostPricing ()

Get Premium Cost Pricing.

Return Value

array

bool isAvailableForPurchase ()

Whether the domain is generally available for purchase

Return Value

bool

bool isMatchingLengthRequirements ()

Checks whether the domain matches length requirements

Return Value

bool

$this setStatus (string $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

string $status

Return Value

$this

string 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.

Return Value

string

string getLegacyStatus ()

Determine legacy status value (pre WHMCS 6.0 logic)

Return Value

string

array toArray ()

Return Value

array

pricing ()

protected DomainPricing calculatePremiumPricing ()

Calculate Premium Pricing with Markup.

Return Value

DomainPricing

Exceptions

NoSale
ContactUs