Documentation

ProductService
in package

WHMCS Product handler

Table of Contents

$likeableFields  : array<string|int, mixed>
$searchableFields  : array<string|int, mixed>
fetchAllByGroupId()  : LengthAwarePaginator
Retrieves all WHMCS Product's of the specified ProductGroup
fetchBennuCloudServices()  : Collection
Fetches all products referred to Bennu Cloud Computing
fetchOne()  : Product
Retrieves a WHMCS Product with the specified id
find()  : LengthAwarePaginator
Retrieves a filtered list of producys. The searchable fields are stored in the `filterableFields` property
compileSelect()  : Builder
Prepare the select statement

Properties

$likeableFields

private array<string|int, mixed> $likeableFields = ['group_name', 'name']

fields queried with like operator

$searchableFields

private array<string|int, mixed> $searchableFields = ['gid' => 'tblproducts.gid', 'group_name' => 'tblproductgroups.name', 'name' => 'tblproducts.name']

searchable fields accepted in the request, translated to raw database field

Methods

fetchAllByGroupId()

Retrieves all WHMCS Product's of the specified ProductGroup

public fetchAllByGroupId(int $productGroupId) : LengthAwarePaginator
Parameters
$productGroupId : int

the

Return values
LengthAwarePaginator

fetchBennuCloudServices()

Fetches all products referred to Bennu Cloud Computing

public fetchBennuCloudServices() : Collection
Return values
Collection

the products corresponding to Bennu Cloud Computing

fetchOne()

Retrieves a WHMCS Product with the specified id

public fetchOne(int $id) : Product
Parameters
$id : int

the id of the WHMCS resource

Return values
Product

the product object instance

find()

Retrieves a filtered list of producys. The searchable fields are stored in the `filterableFields` property

public find([array<string|int, mixed> $criteria = [] ]) : LengthAwarePaginator
Parameters
$criteria : array<string|int, mixed> = []

associative array of field and value

Return values
LengthAwarePaginator

a paginated result

compileSelect()

Prepare the select statement

private compileSelect() : Builder
Return values
Builder

the statement

Search results