CoolCMS API

ProductSetStatistic extends ProductSetStatistic
in package

Daily statistic of a sellable set: an append-only series with one row per day × metric type (`type`, currently only `'views'`: product detail views from the front `registerEvent`, upserted by {@see \App\UI\Api\Eshop\Models\Repositories\Db\ProductSetStatisticRepository::incrementDailyCount()}).

Composite PK (productSetId, type, date); date is type: 'string', not a DateTime object, although the column is a date. Same fix as ProductSetPrice/ProductSetFeePrice: UnitOfWork::getIdHashByIdentifier() runs implode() over the identifier and DateTime is not stringable, so a composite PK with a date object makes every persist()/find() fail fatally. The format Y-m-d is a valid literal for the column.

Writes (upsert) always go through a raw insert … on duplicate key update in the repository, not persist(), and dashboard reads (OrderStatisticsService) use raw aggregate sql. So the entity mostly serves as the Doctrine table mapping (metadata for incrementDailyCount()/getTableName()), not as a hydrated CRUD object.

productSetId stays a scalar int (a dimension axis, no JOIN needed on write or aggregation), like Bazaar AdvertStatistic::$advertId.

Attributes
#[Entity]
#[Table]
$name: 'cms_mod_eshop_product_set_statistics_v2'
#[TableAlias]
'productSetStatistic'

Table of Contents

Constants

TYPE_VIEWS  : mixed = 'views'
Metric type: product detail view (front `registerEvent`).

Properties

$count  : int
$date  : string|null
$productSetId  : int|null
$type  : string|null

Methods

__construct()  : mixed
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
getAllTraits()  : array<string, string>
Returns all traits the class uses, including those used by parent classes and nested traits.
getCount()  : int
getDate()  : string|null
getProductSetId()  : int|null
getType()  : string|null
setCount()  : $this
setDate()  : $this
setProductSetId()  : $this
setType()  : $this
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Constants

TYPE_VIEWS

Metric type: product detail view (front `registerEvent`).

public mixed TYPE_VIEWS = 'views'

Properties

$productSetId

protected int|null $productSetId = null
Attributes
#[Column]
$name: 'cms_mod_eshop_product_sets_product_set_id'
$type: 'integer'
$options: ['unsigned' => true]
#[Id]
#[Identity]

Methods

__construct()

public __construct([int|null $productSetId = null ][, string|null $type = null ][, string|null $date = null ][, int $count = 0 ]) : mixed
Parameters
$productSetId : int|null = null
$type : string|null = null
$date : string|null = null
$count : int = 0

callInitMethods()

Calls `init{TraitName}()` for every used trait that defines such a method.

public callInitMethods() : void

getAllTraits()

Returns all traits the class uses, including those used by parent classes and nested traits.

public getAllTraits() : array<string, string>
Return values
array<string, string>

setCount()

public setCount(int $count) : $this
Parameters
$count : int
Return values
$this

setDate()

public setDate(string|null $date) : $this
Parameters
$date : string|null
Return values
$this

setProductSetId()

public setProductSetId(int|null $productSetId) : $this
Parameters
$productSetId : int|null
Return values
$this

setType()

public setType(string|null $type) : $this
Parameters
$type : string|null
Return values
$this

getTraitsRecursive()

Walks the trait list recursively and collects nested traits too.

private static getTraitsRecursive(array<string, string> $traits) : array<string, string>
Parameters
$traits : array<string, string>
Return values
array<string, string>
On this page

Search results