CoolCMS API

ProductSetPrice extends BaseEntity
in package

AbstractYes

Append-only time series of valid-from prices; future prices are scheduled without a cron (views `max_published_time_for_prices`/`current_prices`, where `published_time <= now()`).

IMPORTANT: price and originalPrice are the base without VAT. The price with VAT is never stored; it is computed with the rate from ProductSetVat (a series per payment region), falling back to the static column ProductSet.vat. Reading these columns as prices with VAT would misprice every set.

Composite PK (set, publishedTime, fromAmount, userGroup, currency) with the owned FK in the PK: the productSet association is owning (#[ORM\Id] in the Api/Admin leaf), the dimension axes (fromAmount, userGroup, currency) stay scalar (like InvoiceTypePdfTemplateVariantRel).

publishedTime is type: 'string', not 'datetime', although the column is a datetime: Doctrine's UnitOfWork::getIdHashByIdentifier() runs implode() over the identifier and DateTime is not stringable, so a composite identifier with a date object makes every persist()/find() fail fatally. The format Y-m-d H:i:s is a valid literal for the column, so the physical schema is unchanged.

Tags
template
Attributes
#[MappedSuperclass]
#[TableAlias]
$alias: 'productSetPrice'

Table of Contents

Properties

$currencyId  : int|null
$fromAmount  : int|null
$originalPrice  : string
$points  : int
$price  : string
$productSet  : TProductSet|null
$publishedTime  : string|null
$userGroupId  : int|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.
getCurrencyId()  : int|null
getFromAmount()  : int|null
getOriginalPrice()  : string
getOriginalPriceAsFloat()  : float
getPoints()  : int
getPrice()  : string
getPriceAsFloat()  : float
getProductSet()  : TProductSet|null
getPublishedTime()  : string|null
getUserGroupId()  : int|null
setCurrencyId()  : $this
setFromAmount()  : $this
setOriginalPrice()  : $this
setPoints()  : $this
setPrice()  : $this
setProductSet()  : $this
setPublishedTime()  : $this
setUserGroupId()  : $this
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$currencyId

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

$fromAmount

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

$originalPrice

protected string $originalPrice = '0.0000'
Attributes
#[Column]
$name: 'original_price'
$type: 'decimal'
$precision: 15
$scale: 4
$options: ['unsigned' => true]

$points

protected int $points = 0
Attributes
#[Column]
$name: 'points'
$type: 'integer'
$options: ['unsigned' => true]

$price

protected string $price = '0.0000'
Attributes
#[Column]
$name: 'price'
$type: 'decimal'
$precision: 15
$scale: 4
$options: ['unsigned' => true]

$publishedTime

protected string|null $publishedTime = null
Attributes
#[Column]
$name: 'published_time'
$type: 'string'
#[Id]
#[Identity]

$userGroupId

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

Methods

__construct()

public __construct([mixed $productSet = null ][, string|null $publishedTime = null ][, int|null $fromAmount = null ][, int|null $userGroupId = null ][, int|null $currencyId = null ][, string $price = '0.0000' ][, string $originalPrice = '0.0000' ][, int $points = 0 ]) : mixed
Parameters
$productSet : mixed = null
$publishedTime : string|null = null
$fromAmount : int|null = null
$userGroupId : int|null = null
$currencyId : int|null = null
$price : string = '0.0000'
$originalPrice : string = '0.0000'
$points : 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>

getCurrencyId()

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

getFromAmount()

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

getOriginalPrice()

public getOriginalPrice() : string
Return values
string

getOriginalPriceAsFloat()

public getOriginalPriceAsFloat() : float
Return values
float

getPriceAsFloat()

public getPriceAsFloat() : float
Return values
float

getProductSet()

public getProductSet() : TProductSet|null
Return values
TProductSet|null

getPublishedTime()

public getPublishedTime() : string|null
Return values
string|null

getUserGroupId()

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

setCurrencyId()

public setCurrencyId(int|null $currencyId) : $this
Parameters
$currencyId : int|null
Return values
$this

setFromAmount()

public setFromAmount(int|null $fromAmount) : $this
Parameters
$fromAmount : int|null
Return values
$this

setOriginalPrice()

public setOriginalPrice(string $originalPrice) : $this
Parameters
$originalPrice : string
Return values
$this

setPoints()

public setPoints(int $points) : $this
Parameters
$points : int
Return values
$this

setPrice()

public setPrice(string $price) : $this
Parameters
$price : string
Return values
$this

setProductSet()

public setProductSet(TProductSet|null $productSet) : $this
Parameters
$productSet : TProductSet|null
Return values
$this

setPublishedTime()

public setPublishedTime(string|null $publishedTime) : $this
Parameters
$publishedTime : string|null
Return values
$this

setUserGroupId()

public setUserGroupId(int|null $userGroupId) : $this
Parameters
$userGroupId : int|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