# 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

| Name | Description |
|  --- | --- |
| `STATUS_REGISTERED` |  |
| `STATUS_NOT_REGISTERED` |  |
| `STATUS_RESERVED` |  |
| `STATUS_UNKNOWN` |  |
| `STATUS_TLD_NOT_SUPPORTED` |  |


## Methods

### __construct

```php
public function __construct($sld, $tld)
```

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

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `string` | `$sld` |  |
| `string` | `$tld` |  |


### factoryFromDomain

```php
public static function factoryFromDomain(Domain $domain)
```

Factory a SearchResult from a regular domain instance

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `Domain` | `$domain` |  |


**Returns** `SearchResult`

### setScore

```php
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**

| Type | Name | Description |
|  --- | --- | --- |
| `float` | `$score` |  |


**Returns** `$this`

### getScore

```php
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

```php
public function setPremiumCostPricing($pricing = [])
```

Set Premium Cost Pricing.

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `array` | `$pricing` |  |


### getPremiumCostPricing

```php
public function getPremiumCostPricing()
```

Get Premium Cost Pricing.

**Returns** `array`

### isAvailableForPurchase

```php
public function isAvailableForPurchase()
```

Whether the domain is generally available for purchase

**Returns** `bool`

### isMatchingLengthRequirements

```php
public function isMatchingLengthRequirements()
```

Checks whether the domain matches length requirements

**Returns** `bool`

### setStatus

```php
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**

| Type | Name | Description |
|  --- | --- | --- |
| `string` | `$status` |  |


**Returns** `$this`

### getStatus

```php
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

```php
public function getLegacyStatus()
```

Determine legacy status value (pre WHMCS 6.0 logic)

**Returns** `string`

### toArray

```php
public function toArray()
```

**Returns** `array`

### validateDomainName

```php
public function validateDomainName(): ?string
```

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

### pricing

```php
public function pricing()
```