CoolCMS API

CategoryPrice extends BaseEntity
in package
implements CategoryPriceInterface

AbstractYes

Price of a paid discussion category (founding a topic) in a payment region, gateway and currency; the same shape as the advert category price.

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

Table of Contents

Interfaces

CategoryPriceInterface
Advert category price in a payment region and currency; the "From …" price on the list is computed from it ({@see \App\Core\Base\Shared\Bazaar\Models\Entities\Category::getMinPriceForPaymentRegion()}).

Properties

$active  : bool
$category  : TCategory|null
$categoryId  : int|null
$currencyId  : int|null
$paymentGateId  : int|null
$paymentRegionId  : int|null
$price  : string
$priceForUnlogged  : string|null

Methods

__construct()  : mixed
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
getActive()  : bool
getAllTraits()  : array<string, string>
Returns all traits the class uses, including those used by parent classes and nested traits.
getCategory()  : TCategory|null
getCategoryId()  : int|null
getCurrencyId()  : int|null
getPaymentGateId()  : int|null
getPaymentRegionId()  : int|null
getPrice()  : string
Returns the price as a decimal string.
getPriceAsFloat()  : float
getPriceForUnlogged()  : string|null
getPriceForUnloggedAsFloat()  : float|null
isActive()  : bool
Returns whether the price counts; an inactive price (gateway disabled in the region) is excluded from the minimum.
setActive()  : $this
setCategory()  : $this
setCategoryId()  : $this
setCurrencyId()  : $this
setPaymentGateId()  : $this
setPaymentRegionId()  : $this
setPrice()  : $this
setPriceForUnlogged()  : $this
setPriceForUnloggedFromFloat()  : $this
setPriceFromFloat()  : $this
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$active

protected bool $active = true
Attributes
#[Column]
$name: 'active'
$type: 'boolean'

$categoryId

protected int|null $categoryId = null
Attributes
#[Column]
$name: 'cms_mod_discussion_categories_category_id'
$type: 'integer'
$insertable: false
$updatable: false
$nullable: true
$options: ['unsigned' => true]

$currencyId

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

$paymentGateId

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

$paymentRegionId

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

$price

protected string $price = '0.000'
Attributes
#[Column]
$name: 'price'
$type: 'decimal'
$precision: 10
$scale: 3

$priceForUnlogged

protected string|null $priceForUnlogged = null
Attributes
#[Column]
$name: 'price_for_unlogged'
$type: 'decimal'
$precision: 10
$scale: 3
$nullable: true

Methods

__construct()

public __construct([mixed $category = null ][, int|null $categoryId = null ][, int|null $paymentRegionId = null ][, int|null $paymentGateId = null ][, int|null $currencyId = null ][, string $price = '0.000' ][, string|null $priceForUnlogged = null ][, bool $active = true ]) : mixed
Parameters
$category : mixed = null
$categoryId : int|null = null
$paymentRegionId : int|null = null
$paymentGateId : int|null = null
$currencyId : int|null = null
$price : string = '0.000'
$priceForUnlogged : string|null = null
$active : bool = true

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>

getCategory()

public getCategory() : TCategory|null
Return values
TCategory|null

getCategoryId()

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

getCurrencyId()

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

getPaymentGateId()

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

getPaymentRegionId()

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

getPrice()

Returns the price as a decimal string.

public getPrice() : string
Return values
string

getPriceAsFloat()

public getPriceAsFloat() : float
Return values
float

getPriceForUnlogged()

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

getPriceForUnloggedAsFloat()

public getPriceForUnloggedAsFloat() : float|null
Return values
float|null

isActive()

Returns whether the price counts; an inactive price (gateway disabled in the region) is excluded from the minimum.

public isActive() : bool
Return values
bool

setActive()

public setActive(bool $active) : $this
Parameters
$active : bool
Return values
$this

setCategory()

public setCategory(TCategory|null $category) : $this
Parameters
$category : TCategory|null
Return values
$this

setCategoryId()

public setCategoryId(int|null $categoryId) : $this
Parameters
$categoryId : int|null
Return values
$this

setCurrencyId()

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

setPaymentGateId()

public setPaymentGateId(int|null $paymentGateId) : $this
Parameters
$paymentGateId : int|null
Return values
$this

setPaymentRegionId()

public setPaymentRegionId(int|null $paymentRegionId) : $this
Parameters
$paymentRegionId : int|null
Return values
$this

setPrice()

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

setPriceForUnlogged()

public setPriceForUnlogged(string|null $priceForUnlogged) : $this
Parameters
$priceForUnlogged : string|null
Return values
$this

setPriceForUnloggedFromFloat()

public setPriceForUnloggedFromFloat(float|null $priceForUnlogged) : $this
Parameters
$priceForUnlogged : float|null
Return values
$this

setPriceFromFloat()

public setPriceFromFloat(float $price) : $this
Parameters
$price : float
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