Blesta Source Documentation

DomainsDomains extends DomainsModel

Domain Manager TLDs Management Model

Table of Contents

Methods

checkAvailability() Checks if a domain is available for registration
checkTransferAvailability() Checks if a domain is available for transfer
getAll() Returns a list with all the Domains for the given company
getExpirationDate() Gets the domain expiration date
getList() Returns a list of Domains for the given company
getListCount() Returns the total number of Domains for the given filters
getNameservers() Get the nameservers for a given domain name
getRegistrationDate() Gets the domain registration date
getStatusCount() Returns the number of results available for the given status
isManagedDomain() Checks if the given service is a domain managed by the domain manager
renewDomain() Renews a domain name
setExpirationDate() Sets the expiration date of a given domain
setRegistrationDate() Sets the registration date of a given domain
updateNameservers() Updates the nameservers of a given domain name
updateRegistrar() Updates the registrar for an existing domain
applyPriceOverrideFilter() Applies price override filter to the given filters arrays
validateRegistrarModule() Validates that a module is a registrar module
Methods

checkAvailability()

Checks if a domain is available for registration

public checkAvailability(string $domain) : bool
Parameters
$domain : string

The domain name to check

Return values
bool

True if the domain is available for registration

checkTransferAvailability()

Checks if a domain is available for transfer

public checkTransferAvailability(string $domain) : bool
Parameters
$domain : string

The domain name to check

Return values
bool

True if the domain is available for transfer

getAll()

Returns a list with all the Domains for the given company

public getAll([array<string|int, mixed> $filters = [] ][, array<string|int, mixed> $order = ['id' => 'asc'] ][, array<string|int, mixed> $formatted_filters = [] ]) : array<string|int, mixed>
Parameters
$filters : array<string|int, mixed> = []

A list of filters for the query

  • client_id The client ID (optional)
  • company_id The ID of the company for which this domain is available (optional)
  • excluded_pricing_term The pricing term by which to exclude results (optional)
  • module_id The module ID on which to filter packages (optional)
  • pricing_period The pricing period for which to fetch services (optional)
  • package_id The package ID (optional)
  • package_name The (partial) name of the packages for which to fetch services (optional)
  • service_meta The (partial) value of meta data on which to filter services (optional)
  • status The status type of the services to fetch (optional, default 'active'):
    • active All active services
    • canceled All canceled services
    • pending All pending services
    • suspended All suspended services
    • in_review All services that require manual review before they may become pending
    • scheduled_cancellation All services scheduled to be canceled
    • all All active/canceled/pending/suspended/in_review
$order : array<string|int, mixed> = ['id' => 'asc']

A key/value pair array of fields to order the results by

$formatted_filters : array<string|int, mixed> = []
Return values
array<string|int, mixed>

An array of stdClass objects

getExpirationDate()

Gets the domain expiration date

public getExpirationDate(int $service_id[, string $format = 'Y-m-d H:i:s' ]) : string
Parameters
$service_id : int

The id of the service where the domain belongs

$format : string = 'Y-m-d H:i:s'

The format to return the expiration date in

Tags
see
Services::get()
Return values
string

The domain expiration date in UTC time in the given format

getList()

Returns a list of Domains for the given company

public getList([array<string|int, mixed> $filters = [] ][, int $page = 1 ][, array<string|int, mixed> $order = ['order' => 'asc'] ]) : array<string|int, mixed>
Parameters
$filters : array<string|int, mixed> = []

A list of filters for the query

  • client_id The client ID (optional)
  • company_id The ID of the company for which this domain is available (optional)
  • excluded_pricing_term The pricing term by which to exclude results (optional)
  • module_id The module ID on which to filter packages (optional)
  • pricing_period The pricing period for which to fetch services (optional)
  • package_id The package ID (optional)
  • package_name The (partial) name of the packages for which to fetch services (optional)
  • service_meta The (partial) value of meta data on which to filter services (optional)
  • status The status type of the services to fetch (optional, default 'active'):
    • active All active services
    • canceled All canceled services
    • pending All pending services
    • suspended All suspended services
    • in_review All services that require manual review before they may become pending
    • scheduled_cancellation All services scheduled to be canceled
    • all All active/canceled/pending/suspended/in_review
$page : int = 1

The page number of results to fetch

$order : array<string|int, mixed> = ['order' => 'asc']

A key/value pair array of fields to order the results by

Return values
array<string|int, mixed>

An array of stdClass objects

getListCount()

Returns the total number of Domains for the given filters

public getListCount([array<string|int, mixed> $filters = [] ]) : int
Parameters
$filters : array<string|int, mixed> = []

A list of filters for the query

  • client_id The client ID (optional)
  • company_id The ID of the company for which this domain is available (optional)
  • excluded_pricing_term The pricing term by which to exclude results (optional)
  • module_id The module ID on which to filter packages (optional)
  • pricing_period The pricing period for which to fetch services (optional)
  • package_id The package ID (optional)
  • package_name The (partial) name of the packages for which to fetch services (optional)
  • service_meta The (partial) value of meta data on which to filter services (optional)
  • status The status type of the services to fetch (optional, default 'active'):
    • active All active services
    • canceled All canceled services
    • pending All pending services
    • suspended All suspended services
    • in_review All services that require manual review before they may become pending
    • scheduled_cancellation All services scheduled to be canceled
    • all All active/canceled/pending/suspended/in_review
Return values
int

The total number of TLDs for the given filters

getNameservers()

Get the nameservers for a given domain name

public getNameservers(int $service_id) : mixed
Parameters
$service_id : int

The id of the service to which the domain belongs

getRegistrationDate()

Gets the domain registration date

public getRegistrationDate(int $service_id[, string $format = 'Y-m-d H:i:s' ]) : string
Parameters
$service_id : int

The id of the service where the domain belongs

$format : string = 'Y-m-d H:i:s'

The format to return the registration date in

Tags
see
Services::get()
Return values
string

The domain registration date in UTC time in the given format

getStatusCount()

Returns the number of results available for the given status

public getStatusCount([string $status = 'active' ][, array<string|int, mixed> $filters = [] ]) : int
Parameters
$status : string = 'active'

The status value to select a count of ('active', 'canceled', 'pending', 'suspended')

$filters : array<string|int, mixed> = []

A list of parameters to filter by, including:

  • client_id The client ID (optional)
  • excluded_pricing_term The pricing term by which to exclude results (optional)
  • module_id The module ID on which to filter packages (optional)
  • pricing_period The pricing period for which to fetch services (optional)
  • package_id The package ID (optional)
  • package_name The (partial) name of the packages for which to fetch services (optional)
  • service_meta The (partial) value of meta data on which to filter services (optional)
  • status The status type of the services to fetch (optional, default 'active'):
    • active All active services
    • canceled All canceled services
    • pending All pending services
    • suspended All suspended services
    • in_review All services that require manual review before they may become pending
    • scheduled_cancellation All services scheduled to be canceled
    • all All active/canceled/pending/suspended/in_review
  • type The type of the services, it can be 'services', 'domains' or null for all (optional, default null)
Return values
int

The number representing the total number of services for this client with that status

isManagedDomain()

Checks if the given service is a domain managed by the domain manager

public isManagedDomain(int $service_id) : bool
Parameters
$service_id : int

The ID of the service to evaluate

Return values
bool

True if the service is a managed domain, false otherwise

renewDomain()

Renews a domain name

public renewDomain(int $service_id[, int $years = 1 ]) : int
Parameters
$service_id : int

The id of the service where the domain belongs

$years : int = 1

The number of years to renew the domain

Return values
int

The ID of the invoice for the domain to be renewed

setExpirationDate()

Sets the expiration date of a given domain

public setExpirationDate(int $service_id, string $expiration_date) : mixed
Parameters
$service_id : int

The ID of the service belonging to the domain

$expiration_date : string

The expiration date of the domain

setRegistrationDate()

Sets the registration date of a given domain

public setRegistrationDate(int $service_id, string $registration_date) : mixed
Parameters
$service_id : int

The ID of the service belonging to the domain

$registration_date : string

The registration date of the domain

updateNameservers()

Updates the nameservers of a given domain name

public updateNameservers(int $service_id, array<string|int, mixed> $nameservers) : mixed
Parameters
$service_id : int

The id of the service where the domain belongs

$nameservers : array<string|int, mixed>

A list of name servers to assign (e.g. [ns1, ns2])

updateRegistrar()

Updates the registrar for an existing domain

public updateRegistrar(int $service_id, int $module_id) : int
Parameters
$service_id : int

The ID of the service associated to the domain

$module_id : int

The ID of the module of the new registrar

Return values
int

The ID of the service, void on error

applyPriceOverrideFilter()

Applies price override filter to the given filters arrays

private applyPriceOverrideFilter(array<string|int, mixed> &$filters, array<string|int, mixed> &$formatted_filters) : mixed
Parameters
$filters : array<string|int, mixed>

The filters array (modified by reference)

$formatted_filters : array<string|int, mixed>

The formatted filters array (modified by reference)

validateRegistrarModule()

Validates that a module is a registrar module

private validateRegistrarModule(stdClass $module) : bool
Parameters
$module : stdClass

The module object to validate

Return values
bool

True if valid registrar module, false otherwise

Tags
subpackage

plugins.domains

copyright

Copyright (c) 2010, Phillips Data, Inc.

license

http://www.blesta.com/license/ The Blesta License Agreement

link

Blesta


        
On this page

Search results