CoolCMS API

Currency extends BaseEntity
in package
implements IdentifiableInterface uses IdentifiableTrait, TranslationCollectionTrait

AbstractYes
Attributes
#[MappedSuperclass]
#[TableAlias]
'currency'

Table of Contents

Interfaces

IdentifiableInterface
Entity with a simple integer primary key. Most entities have one (often via {@see \App\Core\Traits\Shared\Models\Entities\IdentifiableTrait}); texts and links with a composite key do not, which is why `getId()` is not on {@see \App\Core\Base\BaseEntity}. Code that needs the id of a generic entity asks for this interface (parameter type, template bound, `instanceof`).

Properties

$activated  : bool
$creditPrice  : float
$currencySymbolPosition  : string
$decimalSeparator  : string
$exchangeRate  : float
$id  : int|null
$internal  : bool
$key  : string
$monetary  : bool
$name  : string
$negativeSymbolPosition  : string
$noInvoicing  : bool
$orderRoundingWhole  : bool
$precision  : int
$separator  : string
$shortcut  : string
$showSuffix  : bool
$suffix  : string
$translations  : Collection<int, CurrencyText>

Methods

__construct()  : mixed
addTranslation()  : $this
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.
getCreditPrice()  : float
getCurrencySymbolPosition()  : string
getDecimalSeparator()  : string
getExchangeRate()  : float
getId()  : int|null
getInternal()  : bool
getKey()  : string
getName()  : string
getNegativeSymbolPosition()  : string
getNoInvoicing()  : bool
getPrecision()  : int
getSeparator()  : string
getShortcut()  : string
getShowSuffix()  : bool
getSuffix()  : string
getTranslation()  : TTranslation|null
getTranslations()  : Collection<int, TTranslation>
isActivated()  : bool
isInternal()  : bool
isMonetary()  : bool
isNoInvoicing()  : bool
isOrderRoundingWhole()  : bool
isPersisted()  : bool
isShowSuffix()  : bool
removeTranslation()  : $this
setActivated()  : $this
setCreditPrice()  : $this
setCurrencySymbolPosition()  : $this
setDecimalSeparator()  : $this
setExchangeRate()  : $this
setId()  : $this
setInternal()  : $this
setKey()  : $this
setMonetary()  : $this
setName()  : $this
setNegativeSymbolPosition()  : $this
setNoInvoicing()  : $this
setOrderRoundingWhole()  : $this
setPrecision()  : $this
setSeparator()  : $this
setShortcut()  : $this
setShowSuffix()  : $this
setSuffix()  : $this
setTranslations()  : $this
translationCollectionInit()  : void
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$activated

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

$creditPrice

protected float $creditPrice = 0.0
Attributes
#[Column]
$name: 'credit_price'
$type: 'decimal'
$precision: 10
$scale: 3
$options: ['unsigned' => true]

$currencySymbolPosition

protected string $currencySymbolPosition = 'b'
Attributes
#[Column]
$name: 'currency_symbol_position'
$type: 'string'

$decimalSeparator

protected string $decimalSeparator = ''
Attributes
#[Column]
$name: 'decimal_separator'
$type: 'string'
$length: 2

$exchangeRate

protected float $exchangeRate = 0.0
Attributes
#[Column]
$name: 'exchange_rate'
$type: 'decimal'
$precision: 10
$scale: 3

$id

protected int|null $id = null
Attributes
#[Column]
$name: 'currency_id'
$type: 'integer'
$options: ['unsigned' => true]
#[GeneratedValue]
#[Id]

$key

protected string $key = ''
Attributes
#[Column]
$name: '`key`'
$type: 'string'
$length: 10

$name

protected string $name = ''
Attributes
#[Column]
$name: 'name'
$type: 'string'
$length: 100

$negativeSymbolPosition

protected string $negativeSymbolPosition = 'b'
Attributes
#[Column]
$name: 'negative_symbol_position'
$type: 'string'

$noInvoicing

protected bool $noInvoicing = false
Attributes
#[Column]
$name: 'no_invoicing'
$type: 'boolean'

$orderRoundingWhole

protected bool $orderRoundingWhole = false
Attributes
#[Column]
$name: 'order_rounding_whole'
$type: 'boolean'
#[ExternalReadonly]

$precision

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

$separator

protected string $separator = ''
Attributes
#[Column]
$name: 'separator'
$type: 'string'
$length: 2

$shortcut

protected string $shortcut = ''
Attributes
#[Column]
$name: 'shortcut'
$type: 'string'
$length: 5

$showSuffix

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

$suffix

protected string $suffix = ',-'
Attributes
#[Column]
$name: 'suffix'
$type: 'string'
$length: 10
$options: ['default' => ',-']

Methods

__construct()

public __construct([int|null $id = null ][, string $name = '' ][, string $key = '' ][, string $shortcut = '' ][, float $exchangeRate = 0.0 ][, float $creditPrice = 0.0 ][, string $separator = '' ][, string $decimalSeparator = '' ][, int $precision = 2 ][, string $currencySymbolPosition = 'b' ][, string $negativeSymbolPosition = 'b' ][, bool $activated = true ][, bool $showSuffix = true ][, string $suffix = ',-' ][, Collection $translations = new ArrayCollection() ][, bool $noInvoicing = false ][, bool $internal = false ][, bool $monetary = true ][, bool $orderRoundingWhole = false ]) : mixed
Parameters
$id : int|null = null
$name : string = ''
$key : string = ''
$shortcut : string = ''
$exchangeRate : float = 0.0
$creditPrice : float = 0.0
$separator : string = ''
$decimalSeparator : string = ''
$precision : int = 2
$currencySymbolPosition : string = 'b'
$negativeSymbolPosition : string = 'b'
$activated : bool = true
$showSuffix : bool = true
$suffix : string = ',-'
$translations : Collection = new ArrayCollection()
$noInvoicing : bool = false
$internal : bool = false
$monetary : bool = true
$orderRoundingWhole : bool = false

addTranslation()

public addTranslation(TTranslation $translation) : $this
Parameters
$translation : TTranslation
Return values
$this

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>

getCreditPrice()

public getCreditPrice() : float
Return values
float

getCurrencySymbolPosition()

public getCurrencySymbolPosition() : string
Return values
string

getDecimalSeparator()

public getDecimalSeparator() : string
Return values
string

getExchangeRate()

public getExchangeRate() : float
Return values
float

getInternal()

public getInternal() : bool
Return values
bool

getKey()

public getKey() : string
Return values
string

getName()

public getName() : string
Return values
string

getNegativeSymbolPosition()

public getNegativeSymbolPosition() : string
Return values
string

getNoInvoicing()

public getNoInvoicing() : bool
Return values
bool

getPrecision()

public getPrecision() : int
Return values
int

getSeparator()

public getSeparator() : string
Return values
string

getShortcut()

public getShortcut() : string
Return values
string

getShowSuffix()

public getShowSuffix() : bool
Return values
bool

getSuffix()

public getSuffix() : string
Return values
string

getTranslation()

public getTranslation(int $langId) : TTranslation|null
Parameters
$langId : int
Return values
TTranslation|null

getTranslations()

public getTranslations() : Collection<int, TTranslation>
Return values
Collection<int, TTranslation>

isActivated()

public isActivated() : bool
Return values
bool

isInternal()

public isInternal() : bool
Return values
bool

isMonetary()

public isMonetary() : bool
Return values
bool

isNoInvoicing()

public isNoInvoicing() : bool
Return values
bool

isOrderRoundingWhole()

public isOrderRoundingWhole() : bool
Return values
bool

isShowSuffix()

public isShowSuffix() : bool
Return values
bool

removeTranslation()

public removeTranslation(TTranslation $translation) : $this
Parameters
$translation : TTranslation
Return values
$this

setActivated()

public setActivated(bool $activated) : $this
Parameters
$activated : bool
Return values
$this

setCreditPrice()

public setCreditPrice(float $creditPrice) : $this
Parameters
$creditPrice : float
Return values
$this

setCurrencySymbolPosition()

public setCurrencySymbolPosition(string $currencySymbolPosition) : $this
Parameters
$currencySymbolPosition : string
Return values
$this

setDecimalSeparator()

public setDecimalSeparator(string $decimalSeparator) : $this
Parameters
$decimalSeparator : string
Return values
$this

setExchangeRate()

public setExchangeRate(float $exchangeRate) : $this
Parameters
$exchangeRate : float
Return values
$this

setId()

public setId(int|null $id) : $this
Parameters
$id : int|null
Return values
$this

setInternal()

public setInternal(bool $internal) : $this
Parameters
$internal : bool
Return values
$this

setKey()

public setKey(string $key) : $this
Parameters
$key : string
Return values
$this

setMonetary()

public setMonetary(bool $monetary) : $this
Parameters
$monetary : bool
Return values
$this

setName()

public setName(string $name) : $this
Parameters
$name : string
Return values
$this

setNegativeSymbolPosition()

public setNegativeSymbolPosition(string $negativeSymbolPosition) : $this
Parameters
$negativeSymbolPosition : string
Return values
$this

setNoInvoicing()

public setNoInvoicing(bool $noInvoicing) : $this
Parameters
$noInvoicing : bool
Return values
$this

setOrderRoundingWhole()

public setOrderRoundingWhole(bool $orderRoundingWhole) : $this
Parameters
$orderRoundingWhole : bool
Return values
$this

setPrecision()

public setPrecision(int $precision) : $this
Parameters
$precision : int
Return values
$this

setSeparator()

public setSeparator(string $separator) : $this
Parameters
$separator : string
Return values
$this

setShortcut()

public setShortcut(string $shortcut) : $this
Parameters
$shortcut : string
Return values
$this

setShowSuffix()

public setShowSuffix(bool $showSuffix) : $this
Parameters
$showSuffix : bool
Return values
$this

setSuffix()

public setSuffix(string $suffix) : $this
Parameters
$suffix : string
Return values
$this

setTranslations()

public setTranslations(Collection<int, TTranslation>|array<int, TTranslation> $translations) : $this
Parameters
$translations : Collection<int, TTranslation>|array<int, TTranslation>
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