WhmcsProducts
Fetch Products, TLDs, Product Pricing, and TLD Pricing
Table of Contents
Methods
| __construct() | |
| get() | Fetches a PDOStatement for all products |
| getConfigOptionGroups() | Fetches all config options groups |
| getConfigOptions() | Fetches all config options for a specific group ID |
| getConfigOptionTypes() | Returns config option types |
| getPricing() | Get pricing for the given type |
| getRegistrarFields() | Returns a key/value pair array of field names and values for the given registrar |
| getReigstrars() | Get All Registrars |
| getServers() | Get Generic module rows |
| getTldPricing() | Get pricing for the given domain TLD |
| getTlds() | Fetches a PDOStatement for all TLDs |
| getConfigOptionGroupLinks() | Fetches all group to package associations |
| getPricingOverrides() | Fetches all pricing overrides (not necessarily unique from package pricing, but overriden nonetheless) |
| getTldPricingOverrides() | Fetches all pricing overrides (not necessarily unique from package pricing, but overriden nonetheless) |
| mergePrices() | Merges prices between two pricing arrays based on term, period, and currency |
Methods
__construct()
public
__construct(Record $remote) : mixed
Parameters
- $remote : Record
get()
Fetches a PDOStatement for all products
public
get() : PDOStatement
Return values
PDOStatementgetConfigOptionGroups()
Fetches all config options groups
public
getConfigOptionGroups() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array of package option groups, with associated packages
getConfigOptions()
Fetches all config options for a specific group ID
public
getConfigOptions(int $group_id) : array<string|int, mixed>
Parameters
- $group_id : int
-
The ID of the group to fetch options for
Return values
array<string|int, mixed> —An array of stdClass objects, each representing a config option with its values
getConfigOptionTypes()
Returns config option types
public
getConfigOptionTypes() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array of optiontype values and their representation
getPricing()
Get pricing for the given type
public
getPricing(int $relid[, mixed $type = 'product' ]) : array<string|int, mixed>
Parameters
- $relid : int
-
The ID of the product/configoption/etc.
- $type : mixed = 'product'
Return values
array<string|int, mixed> —A numerically indexed array of pricing each containing:
- term
- period
- price
- setupfee
- currency
getRegistrarFields()
Returns a key/value pair array of field names and values for the given registrar
public
getRegistrarFields(string $registrar) : array<string|int, mixed>
Parameters
- $registrar : string
-
The registrar to fetch all key/value pairs for
Return values
array<string|int, mixed> —An array of key/value pairs for the registrar
getReigstrars()
Get All Registrars
public
getReigstrars() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array of all installed registrars
getServers()
Get Generic module rows
public
getServers() : PDOStatement
Return values
PDOStatement —Each row representing a module row
getTldPricing()
Get pricing for the given domain TLD
public
getTldPricing(int $tld[, string $type = null ]) : array<string|int, mixed>
Parameters
- $tld : int
-
The domain TLD
- $type : string = null
-
The type of pricing to fetch ('domainregister', 'domaintransfer', 'domainrenew')
Return values
array<string|int, mixed> —A numerically indexed array of pricing each containing:
- term
- period
- price
- setupfee
- currency
getTlds()
Fetches a PDOStatement for all TLDs
public
getTlds() : PDOStatement
Return values
PDOStatementgetConfigOptionGroupLinks()
Fetches all group to package associations
private
getConfigOptionGroupLinks(int $group_id) : array<string|int, mixed>
Parameters
- $group_id : int
-
The ID of the group to fetch associations on
Return values
array<string|int, mixed> —An array of objects, each representing a group and package assignment
getPricingOverrides()
Fetches all pricing overrides (not necessarily unique from package pricing, but overriden nonetheless)
private
getPricingOverrides(int $product_id) : array<string|int, mixed>
Parameters
- $product_id : int
-
The product ID
Return values
array<string|int, mixed> —A numerically indexed array of pricing each containing:
- term
- period
- price
- currency
getTldPricingOverrides()
Fetches all pricing overrides (not necessarily unique from package pricing, but overriden nonetheless)
private
getTldPricingOverrides(mixed $tld) : array<string|int, mixed>
Parameters
- $tld : mixed
Return values
array<string|int, mixed> —A numerically indexed array of pricing each containing:
- term
- period
- price
- setupfee
- currency
mergePrices()
Merges prices between two pricing arrays based on term, period, and currency
private
mergePrices(array<string|int, mixed> $prices1, array<string|int, mixed> $prices2) : array<string|int, mixed>
Parameters
- $prices1 : array<string|int, mixed>
- $prices2 : array<string|int, mixed>
Return values
array<string|int, mixed> —An array of merged pricing