CoolCMS API

ProductSetService extends ApiService
in package
implements ServiceInterface

Front service that reads entities through the mapper.

Tags
extends

Table of Contents

Interfaces

ServiceInterface
Contract of the front service layer.

Properties

$mapper  : ProductSetMapper

Methods

__construct()  : mixed
fetchAvailability()  : array<int, array{availableSets: ?int, inStock: bool, deliveryDays: ?int, labelWarehouseId: ?int, infoText: ?string, attributeClass: ?string, unmappedVariantIds: list, unresolvedSetIds: list}>
fetchCurrentPrices()  : array<int, array{price: string, originalPrice: string, points: int, fromAmount: int, currencyId: int, vat: string, withVat: bool}>
fetchGifts()  : array<int, array{name: string, amount: int}>
See {@see \App\UI\Front\Eshop\Models\Repositories\Api\ProductSetRepository::fetchGifts()}.
fetchNextPriceTimes()  : array<int, string>
Returns the end of the deal for the countdown, in a batch; see {@see ProductSetMapper::fetchNextPriceTimes()}.
fetchParameterValueCounts()  : array<int, array<string|int, int>>
Returns set counts by parameter value; see {@see \App\UI\Api\Eshop\Models\Managers\ProductSetManager::fetchParameterValueCounts()}.
fetchPriceDisplay()  : array{paymentRegionId: int, chargeVat: bool, noteKey: ?string}
Returns the catalog display treatment; see {@see \App\UI\Front\Eshop\Models\Repositories\Api\ProductSetRepository::fetchPriceDisplay()}.
find()  : T|null
Finds one entity by id.
findAll()  : T>, 1: int}
Finds all entities matching the criteria.
findBy()  : T|null
Finds one entity by filters.
getTotalCount()  : int|null
registerView()  : void
search()  : ProductSet>, 1: int, 2: bool, 3: array>}|null
Searches through the Api endpoint `search` (see {@see ProductSetMapper::search()}).

Properties

Methods

fetchAvailability()

public fetchAvailability(array<string|int, int> $ids[, int|null $languageId = null ]) : array<int, array{availableSets: ?int, inStock: bool, deliveryDays: ?int, labelWarehouseId: ?int, infoText: ?string, attributeClass: ?string, unmappedVariantIds: list, unresolvedSetIds: list}>
Parameters
$ids : array<string|int, int>
$languageId : int|null = null
Return values
array<int, array{availableSets: ?int, inStock: bool, deliveryDays: ?int, labelWarehouseId: ?int, infoText: ?string, attributeClass: ?string, unmappedVariantIds: list, unresolvedSetIds: list}>

fetchCurrentPrices()

public fetchCurrentPrices(array<string|int, int> $ids[, int|null $userGroupId = null ][, int|null $currencyId = null ][, int $amount = 1 ][, int|null $paymentRegionId = null ]) : array<int, array{price: string, originalPrice: string, points: int, fromAmount: int, currencyId: int, vat: string, withVat: bool}>
Parameters
$ids : array<string|int, int>
$userGroupId : int|null = null
$currencyId : int|null = null
$amount : int = 1
$paymentRegionId : int|null = null
Return values
array<int, array{price: string, originalPrice: string, points: int, fromAmount: int, currencyId: int, vat: string, withVat: bool}>

fetchGifts()

See {@see \App\UI\Front\Eshop\Models\Repositories\Api\ProductSetRepository::fetchGifts()}.

public fetchGifts(int $setId[, int|null $languageId = null ]) : array<int, array{name: string, amount: int}>
Parameters
$setId : int
$languageId : int|null = null
Return values
array<int, array{name: string, amount: int}>

fetchNextPriceTimes()

Returns the end of the deal for the countdown, in a batch; see {@see ProductSetMapper::fetchNextPriceTimes()}.

public fetchNextPriceTimes(array<string|int, int> $ids[, int|null $currencyId = null ]) : array<int, string>
Parameters
$ids : array<string|int, int>
$currencyId : int|null = null
Return values
array<int, string> —

setId => nearest future published_time

fetchParameterValueCounts()

Returns set counts by parameter value; see {@see \App\UI\Api\Eshop\Models\Managers\ProductSetManager::fetchParameterValueCounts()}.

public fetchParameterValueCounts(array<int, object> $filters) : array<int, array<string|int, int>>
Parameters
$filters : array<int, object>
Return values
array<int, array<string|int, int>> —

parameterId => [value => count]

fetchPriceDisplay()

Returns the catalog display treatment; see {@see \App\UI\Front\Eshop\Models\Repositories\Api\ProductSetRepository::fetchPriceDisplay()}.

public fetchPriceDisplay([int|null $paymentRegionId = null ]) : array{paymentRegionId: int, chargeVat: bool, noteKey: ?string}
Parameters
$paymentRegionId : int|null = null
Return values
array{paymentRegionId: int, chargeVat: bool, noteKey: ?string}

find()

Finds one entity by id.

public find(int $id[, string|array<string|int, mixed> $includes = [] ][, bool|null $useCache = null ]) : T|null
Parameters
$id : int
$includes : string|array<string|int, mixed> = []
$useCache : bool|null = null
Return values
T|null

findAll()

Finds all entities matching the criteria.

public findAll([array<string|int, mixed>|null $filters = [] ][, array<string|int, mixed>|null $orderBys = null ][, int|null $offset = null ][, int|null $limit = null ][, array<string|int, mixed>|null $columns = null ][, bool $computeTotalCount = false ][, string|array<string|int, mixed> $includes = [] ][, bool|null $useCache = null ]) : T>, 1: int}
Parameters
$filters : array<string|int, mixed>|null = []
$orderBys : array<string|int, mixed>|null = null
$offset : int|null = null
$limit : int|null = null
$columns : array<string|int, mixed>|null = null
$computeTotalCount : bool = false
$includes : string|array<string|int, mixed> = []
$useCache : bool|null = null
Return values
T>, 1: int}

findBy()

Finds one entity by filters.

public findBy([array<string|int, mixed>|null $filters = [] ][, string|array<string|int, mixed>|null $includes = [] ][, bool|null $useCache = null ]) : T|null
Parameters
$filters : array<string|int, mixed>|null = []
$includes : string|array<string|int, mixed>|null = []
$useCache : bool|null = null
Return values
T|null

getTotalCount()

public getTotalCount() : int|null
Return values
int|null

Searches through the Api endpoint `search` (see {@see ProductSetMapper::search()}).

public search(string $search, string|null $languageAlias[, array<int, object|array<string, mixed>> $filters = [] ][, array<string, mixed>|null $orderBys = null ][, int|null $offset = null ][, int|null $limit = null ][, string|array<int, string> $includes = [] ]) : ProductSet>, 1: int, 2: bool, 3: array>}|null
Parameters
$search : string
$languageAlias : string|null
$filters : array<int, object|array<string, mixed>> = []
$orderBys : array<string, mixed>|null = null
$offset : int|null = null
$limit : int|null = null
$includes : string|array<int, string> = []
Return values
ProductSet>, 1: int, 2: bool, 3: array>}|null
On this page

Search results